Skip to content

Commit

Permalink
- SlideMax : transition:none; 실행이후 1000/1초 이내로 transition을 실행하면 none이…
Browse files Browse the repository at this point in the history
… 무시되기 때문에 delay 처리
  • Loading branch information
이진오 committed Apr 20, 2018
1 parent ca4bc16 commit 7f3221c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ module.exports = function ( grunt ) {
dest: 'test/'
}],
options: {
//ixBand new version source
//ixSnack new version source
replacements: [{
pattern: /\/v[0-9.]+\/ixSnack/g,
replacement: '/'
}, {
pattern: /\/ixBand_([0-9.]+)(.min)*.js/g,
pattern: /\/ixSnack_([0-9.]+)(.min)*.js/g,
replacement: function ( match, p1, p2 ) {
return '/ixSnack_' + pkg.version + ( p2 || '' ) + '.js';
}
Expand Down
8 changes: 4 additions & 4 deletions dist/ixSnack.min.js

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions dist/ixSnack_0.4.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* ixSnack - Javascript Library (jQuery plugin)
* jQuery v1.8~ (http://jquery.com) + ixBand v1.0~ (http://ixband.com)
* @version v0.4.3 (1804161458)
* @version v0.4.3 (1804201550)
* The MIT License (MIT), http://ixsnack.com
*/
;(function ( $, $B ) {
Expand Down Expand Up @@ -70,22 +70,22 @@
},

hasPlugin: function ( $target, pluginName ) {
return ( $target.prop(pluginName) && $target.hasClass('ix-' + pluginName + '-apply') );
return ( $target.prop('ix-' + pluginName) && $target.hasClass('ix-' + pluginName + '-apply') );
},

addPlugin: function ( $target, pluginName, plugin ) {
$target.prop( pluginName, _pluginId ).addClass( 'ix-' + pluginName + '-apply' );
$target.prop( 'ix-' + pluginName, _pluginId ).addClass( 'ix-' + pluginName + '-apply' );
_pluginPool[_pluginId] = plugin;
_pluginId++;
},

removePlugin: function ( $target, pluginName ) {
$target.removeProp( pluginName ).removeClass( 'ix-' + pluginName + '-apply' ).removeClass( 'ix-options-apply' );
$target.removeProp( 'ix-' + pluginName ).removeClass( 'ix-' + pluginName + '-apply' ).removeClass( 'ix-options-apply' );
delete _pluginPool[$target.prop(pluginName)];
},

callPlugin: function ( $target, pluginName, method, val1, val2 ) {
var pluginId = $target.prop( pluginName );
var pluginId = $target.prop( 'ix-' + pluginName );
if ( _pluginPool[pluginId] && typeof _pluginPool[pluginId][method] === 'function' ) {
return _pluginPool[pluginId][method]( val1, val2 );
}
Expand Down Expand Up @@ -219,6 +219,7 @@

if ( notAni ) {
$B( $el ).transition( prop, 'none' );
$el.prop( 'ix-noneTransitionTime', new Date().getTime() );
if ( typeof callback === 'function' ) callback( {data: data} );
} else {
var easing = ( ixSnack.getCssEasing ) ? ixSnack.getCssEasing( options.easing ) : options.easing,
Expand All @@ -227,15 +228,16 @@
//onTransitionEnd 이벤트가 발생하지 않을경우 대비
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}, options.duration * 2 ) : null;
}, options.duration * 1.5 ) : null,
timeGap = new Date().getTime() - ( $el.prop('ix-noneTransitionTime') || 0 );

//style적용 바로 이후 실행될때 transition이 제대로 실행되기 위한
setTimeout( function (e) {
$B( $el ).transition( prop, opt, {onTransitionEnd: function (e) {
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}});
}, 0);
}, timeGap < 5? 30 : 0);//transition:none; 실행이후 1000/1초 이내로 transition을 실행하면 none이 무시되기 때문에 delay 처리
}
} else {
prop = ( options.axis === 'horizontal' ) ? {left: pos} : {top: pos};
Expand Down Expand Up @@ -268,22 +270,24 @@
if ( ixSnack.TRANSFORM ) {
if ( notAni ) {
$B( $el ).transition( prop + ':' + value, 'none' );
$el.prop( 'ix-noneTransitionTime', new Date().getTime() );
if ( typeof callback === 'function' ) callback( {data: data} );
} else {
var easing = ( ixSnack.getCssEasing ) ? ixSnack.getCssEasing( options.easing ) : options.easing,
autoComplete = ( typeof callback === 'function' )? setTimeout( function (e) {
//onTransitionEnd 이벤트가 발생하지 않을경우 대비
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}, options.duration * 2 ) : null;
}, options.duration * 1.5 ) : null,
timeGap = new Date().getTime() - ( $el.prop('ix-noneTransitionTime') || 0 );

//style적용 바로 이후 실행될때 transition이 제대로 실행되기 위한
setTimeout( function (e) {
$B( $el ).transition( prop + ':' + value, prop + ' ' + options.duration + 'ms ' + easing + ';', {onTransitionEnd: function (e) {
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}});
}, 0);
}, timeGap < 5? 30 : 0);//transition:none; 실행이후 1000/1초 이내로 transition을 실행하면 none이 무시되기 때문에 delay 처리
}
} else {
var aniStyle = {};
Expand Down Expand Up @@ -496,7 +500,6 @@ ixSnack.ListIndexManager = $B.Class.extend({
if ( isInput ) {
var nextRangeIdx = ( rangeLength > 0 )? nextSelectIdx + this._options.viewLength : nextSelectIdx - this._options.viewLength;

//datumPoint 설정시 1개 정도 더 보여야 해서
if ( nextRangeIdx < 1 ) {
this._dispatch( 'correct', this._lastCloneStartIdx - (this._originStartIdx - this._selectIdx) );
nextSelectIdx = this._selectIdx + rangeLength;
Expand Down
8 changes: 4 additions & 4 deletions dist/ixSnack_0.4.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/ListIndexManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ ixSnack.ListIndexManager = $B.Class.extend({
if ( isInput ) {
var nextRangeIdx = ( rangeLength > 0 )? nextSelectIdx + this._options.viewLength : nextSelectIdx - this._options.viewLength;

//datumPoint 설정시 1개 정도 더 보여야 해서
if ( nextRangeIdx < 1 ) {
this._dispatch( 'correct', this._lastCloneStartIdx - (this._originStartIdx - this._selectIdx) );
nextSelectIdx = this._selectIdx + rangeLength;
Expand Down
20 changes: 12 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ window.ixSnack = {
},

hasPlugin: function ( $target, pluginName ) {
return ( $target.prop(pluginName) && $target.hasClass('ix-' + pluginName + '-apply') );
return ( $target.prop('ix-' + pluginName) && $target.hasClass('ix-' + pluginName + '-apply') );
},

addPlugin: function ( $target, pluginName, plugin ) {
$target.prop( pluginName, _pluginId ).addClass( 'ix-' + pluginName + '-apply' );
$target.prop( 'ix-' + pluginName, _pluginId ).addClass( 'ix-' + pluginName + '-apply' );
_pluginPool[_pluginId] = plugin;
_pluginId++;
},

removePlugin: function ( $target, pluginName ) {
$target.removeProp( pluginName ).removeClass( 'ix-' + pluginName + '-apply' ).removeClass( 'ix-options-apply' );
$target.removeProp( 'ix-' + pluginName ).removeClass( 'ix-' + pluginName + '-apply' ).removeClass( 'ix-options-apply' );
delete _pluginPool[$target.prop(pluginName)];
},

callPlugin: function ( $target, pluginName, method, val1, val2 ) {
var pluginId = $target.prop( pluginName );
var pluginId = $target.prop( 'ix-' + pluginName );
if ( _pluginPool[pluginId] && typeof _pluginPool[pluginId][method] === 'function' ) {
return _pluginPool[pluginId][method]( val1, val2 );
}
Expand Down Expand Up @@ -210,6 +210,7 @@ window.ixSnack = {

if ( notAni ) {
$B( $el ).transition( prop, 'none' );
$el.prop( 'ix-noneTransitionTime', new Date().getTime() );
if ( typeof callback === 'function' ) callback( {data: data} );
} else {
var easing = ( ixSnack.getCssEasing ) ? ixSnack.getCssEasing( options.easing ) : options.easing,
Expand All @@ -218,15 +219,16 @@ window.ixSnack = {
//onTransitionEnd 이벤트가 발생하지 않을경우 대비
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}, options.duration * 2 ) : null;
}, options.duration * 1.5 ) : null,
timeGap = new Date().getTime() - ( $el.prop('ix-noneTransitionTime') || 0 );

//style적용 바로 이후 실행될때 transition이 제대로 실행되기 위한
setTimeout( function (e) {
$B( $el ).transition( prop, opt, {onTransitionEnd: function (e) {
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}});
}, 0);
}, timeGap < 5? 30 : 0);//transition:none; 실행이후 1000/1초 이내로 transition을 실행하면 none이 무시되기 때문에 delay 처리
}
} else {
prop = ( options.axis === 'horizontal' ) ? {left: pos} : {top: pos};
Expand Down Expand Up @@ -259,22 +261,24 @@ window.ixSnack = {
if ( ixSnack.TRANSFORM ) {
if ( notAni ) {
$B( $el ).transition( prop + ':' + value, 'none' );
$el.prop( 'ix-noneTransitionTime', new Date().getTime() );
if ( typeof callback === 'function' ) callback( {data: data} );
} else {
var easing = ( ixSnack.getCssEasing ) ? ixSnack.getCssEasing( options.easing ) : options.easing,
autoComplete = ( typeof callback === 'function' )? setTimeout( function (e) {
//onTransitionEnd 이벤트가 발생하지 않을경우 대비
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}, options.duration * 2 ) : null;
}, options.duration * 1.5 ) : null,
timeGap = new Date().getTime() - ( $el.prop('ix-noneTransitionTime') || 0 );

//style적용 바로 이후 실행될때 transition이 제대로 실행되기 위한
setTimeout( function (e) {
$B( $el ).transition( prop + ':' + value, prop + ' ' + options.duration + 'ms ' + easing + ';', {onTransitionEnd: function (e) {
if ( autoComplete ) clearTimeout( autoComplete );
if ( typeof callback === 'function' ) callback( {data: data} );
}});
}, 0);
}, timeGap < 5? 30 : 0);//transition:none; 실행이후 1000/1초 이내로 transition을 실행하면 none이 무시되기 때문에 delay 처리
}
} else {
var aniStyle = {};
Expand Down

0 comments on commit 7f3221c

Please sign in to comment.