Skip to content

Commit

Permalink
Do not animate tab transitions if data-swipe="false" (#105)
Browse files Browse the repository at this point in the history
* FIX turn off tab change animation on data-swipe="false"
  • Loading branch information
Andrej Kabachnik authored and wildhaber committed Sep 26, 2017
1 parent 1c2bb6e commit 57e22d6
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions js/nativedroid2.js
Expand Up @@ -272,19 +272,27 @@

// Activate Content Tab
var oldContent = obj.closest('.ui-page').find(".nd2Tabs-content-tab.nd2Tab-active");

oldContent.addClass("to-" + directionTo);
window.setTimeout(function() {
oldContent.removeClass("nd2Tab-active to-" + directionTo);
}, 400);

if (_self.element.data('swipe')){
oldContent.addClass("to-" + directionTo);
window.setTimeout(function() {
oldContent.removeClass("nd2Tab-active to-" + directionTo);
}, 400);
} else {
oldContent.removeClass("nd2Tab-active");
}

var newContent = obj.closest('.ui-page').find(".nd2Tabs-content-tab[data-tab='" + _self.settings.activeTab + "']");

newContent.addClass("nd2Tab-active from-" + direction);

window.setTimeout(function() {
newContent.removeClass("from-" + direction);
}, 150);

if (_self.element.data('swipe')){
newContent.addClass("nd2Tab-active from-" + direction);

window.setTimeout(function() {
newContent.removeClass("from-" + direction);
}, 150);
} else {
newContent.addClass("nd2Tab-active");
}

},
prepareTabs: function() {
Expand Down

0 comments on commit 57e22d6

Please sign in to comment.