diff --git a/src/modules/popup.js b/src/modules/popup.js index a609457ef..372aa3b77 100755 --- a/src/modules/popup.js +++ b/src/modules/popup.js @@ -204,6 +204,7 @@ $.fn.popup = function(parameters) { if( !module.exists() ) { module.create(); } + module.save.conditions(); module.set.position(); module.animate.show(callback); }, @@ -214,6 +215,7 @@ $.fn.popup = function(parameters) { $module .removeClass(className.visible) ; + module.restore.conditions(); module.unbind.close(); if( module.is.visible() ) { module.animate.hide(callback); @@ -250,6 +252,29 @@ $.fn.popup = function(parameters) { ; }, + save: { + conditions: function () { + module.cache = { + title: $module.attr('title') + }; + if (module.cache.title) { + $module.attr('title', ''); + } + module.verbose('Saving original attributes', module.cache); + } + }, + restore: { + conditions: function () { + if (module.cache === undefined) { + module.error(error.cache); + return false; + } + if (module.cache.title) { + $module.attr('title', module.cache.title); + } + module.verbose('Restoring original attributes', module.cache); + } + }, animate: { show: function(callback) { callback = callback || function(){}; diff --git a/src/modules/transition.js b/src/modules/transition.js index 4129836fa..e1a2f1d89 100755 --- a/src/modules/transition.js +++ b/src/modules/transition.js @@ -165,9 +165,20 @@ $.fn.transition = function() { $.proxy(settings.complete, this)(); }, - repaint: function(fakeAssignment) { + repaint: function(removeThenAdd) { module.verbose('Forcing repaint event'); - fakeAssignment = element.offsetWidth; + var fakeAssignment = element.offsetWidth; + if (removeThenAdd) { + var parent = $module.parent(); + //element not attached yet. + if (parent.length == 0) + return; + var next = $module.next(); + if (next.length == 0) + $module.detach().appendTo(parent); + else + $module.detach().insertBefore(next); + } }, has: { @@ -250,7 +261,7 @@ $.fn.transition = function() { restore: { conditions: function() { - if(typeof module.cache === undefined) { + if(module.cache === undefined) { module.error(error.cache); return false; } @@ -426,7 +437,7 @@ $.fn.transition = function() { .addClass(className.transition) .addClass(className.visible) ; - module.repaint(); + module.repaint(true/*or better: true only if its IE*/); }, start: function() {