Browse Source

Add support for onHide callback in nag.js.

Former-commit-id: 300dc83791
Former-commit-id: 6436a860d4
pull/258/head
Graham Blache 11 years ago
parent
commit
d6425b3d5c
1 changed files with 17 additions and 5 deletions
  1. 22
      src/modules/nag.js

22
src/modules/nag.js

@ -116,12 +116,20 @@
; ;
} }
}, },
hide: function() { hide: function() {
$module $module
.fadeOut(settings.duration, settings.easing)
.fadeOut(settings.duration, settings.easing, this.onHide)
; ;
}, },
onHide: function() {
$module.remove();
if (settings.onHide) {
settings.onHide();
};
},
stick: function() { stick: function() {
module.refresh(); module.refresh();
@ -144,7 +152,7 @@
else { else {
$module $module
.css({ .css({
top : yPosition
top : yPosition
}) })
; ;
} }
@ -152,15 +160,17 @@
unStick: function() { unStick: function() {
$module $module
.css({ .css({
top : ''
top : ''
}) })
; ;
}, },
dismiss: function() {
dismiss: function(event) {
if(settings.storageMethod) { if(settings.storageMethod) {
module.storage.set(settings.storedKey, settings.storedValue); module.storage.set(settings.storedKey, settings.storedValue);
} }
module.hide(); module.hide();
event.stopImmediatePropagation();
event.preventDefault();
}, },
should: { should: {
@ -321,7 +331,9 @@
}, },
speed : 500, speed : 500,
easing : 'easeOutQuad'
easing : 'easeOutQuad',
onHide: function() {}
}; };

Loading…
Cancel
Save