Browse Source

Merge pull request #433 from MohammadYounes/master

Fix issue #409
pull/470/merge
Jack Lukic 11 years ago
parent
commit
d7c6a8d700
2 changed files with 40 additions and 4 deletions
  1. 25
      src/modules/popup.js
  2. 19
      src/modules/transition.js

25
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(){};

19
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() {

Loading…
Cancel
Save