mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
jslint 2
This commit is contained in:
parent
7d9c78c081
commit
56a57de8e1
@ -41,27 +41,27 @@ var IPython = (function (IPython) {
|
||||
// click_callback : function called if user click on notification
|
||||
// could return false to prevent the notification to be dismissed
|
||||
NotificationWidget.prototype.set_message = function (msg, timeout, click_callback) {
|
||||
var callback = click_callback || function(){return false};
|
||||
var callback = click_callback || function() {return false;};
|
||||
var that = this;
|
||||
this.element.html(msg);
|
||||
this.element.fadeIn(100);
|
||||
if (this.timeout !== null) {
|
||||
clearTimeout(this.timeout);
|
||||
this.timeout = null;
|
||||
};
|
||||
}
|
||||
if (timeout !== undefined && timeout >=0) {
|
||||
this.timeout = setTimeout(function () {
|
||||
that.element.fadeOut(100, function () {that.element.html('');});
|
||||
that.timeout = null;
|
||||
}, timeout);
|
||||
} else {
|
||||
this.element.click(function(){
|
||||
if( callback() != false){
|
||||
this.element.click(function() {
|
||||
if( callback() != false ) {
|
||||
that.element.fadeOut(100, function () {that.element.html('');});
|
||||
that.element.unbind('click')
|
||||
that.element.unbind('click');
|
||||
}
|
||||
if (that.timeout !== undefined) {
|
||||
that.timeout = undefined
|
||||
that.timeout = undefined;
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user