Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Prevent auto hide on close btn visible #4

Closed
wants to merge 2 commits into from

2 participants

@straeger

my fork adds the possibility to prevent the auto hide on close button visible by giving the option respectHideDelay.

If set to true the notify bar will stay open and ignore the timer which removes the bar.

If the parameter (respectHideDelay) is not given as option the bars will be removed as normal after the time of the option delay.

@dknight dknight closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 28, 2012
  1. adds possibility to config the bar as always visible if the close opt…

    Stephan authored
    …ion (close btn visible) is set to true
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 9 deletions.
  1. +15 −9 jquery.notifyBar.js
View
24 jquery.notifyBar.js
@@ -40,8 +40,11 @@ jQuery.notifyBar = function(settings) {
//Set up own class
notifyBarNS.cls = settings.cls || "";
- //close button
- notifyBarNS.close = settings.close || false;
+ //close button if injected as true the delay is not needed until the hideDelayedOnCloseBtnVisible is set to true
+ notifyBarNS.close = settings.close || false;
+
+ //hide the bar even if close btn option is set to true
+ notifyBarNS.respectHideDelay = settings.respectHideDelay == undefined ? true : settings.respectHideDelay;
if( notifyBarNS.jqObject) {
bar = notifyBarNS.jqObject;
@@ -99,11 +102,14 @@ jQuery.notifyBar = function(settings) {
$(this).slideUp(asTime);
})
- // If taken from DOM dot not remove just hide
- if( bar.attr("id") == "__notifyBar") {
- setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "').remove()});", notifyBarNS.delay + asTime);
- } else {
- setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "')});", notifyBarNS.delay + asTime);
- }
-
+ // If taken from DOM dot not remove just hide
+ if (!notifyBarNS.close || (notifyBarNS.close && notifyBarNS.respectHideDelay)) {
+ // If taken from DOM dot not remove just hide
+ if( bar.attr("id") == "__notifyBar") {
+ setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "').remove()});", notifyBarNS.delay + asTime);
+ } else {
+ setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "')});", notifyBarNS.delay + asTime);
+ }
+ }
+
})(jQuery) };
Something went wrong with that request. Please try again.