Commit bdd41a19 authored by csillag's avatar csillag

Update Annotator to 6b6cb4ba (from typed-packaging branch)

parent 187281e7
...@@ -53,9 +53,10 @@ class Annotator.Notification extends Delegator ...@@ -53,9 +53,10 @@ class Annotator.Notification extends Delegator
# #
# Returns itself. # Returns itself.
show: (message, status=Annotator.Notification.INFO) => show: (message, status=Annotator.Notification.INFO) =>
@currentStatus = status
$(@element) $(@element)
.addClass(@options.classes.show) .addClass(@options.classes.show)
.addClass(@options.classes[status]) .addClass(@options.classes[@currentStatus])
.html(Util.escape(message || "")) .html(Util.escape(message || ""))
setTimeout this.hide, 5000 setTimeout this.hide, 5000
...@@ -70,7 +71,10 @@ class Annotator.Notification extends Delegator ...@@ -70,7 +71,10 @@ class Annotator.Notification extends Delegator
# #
# Returns itself. # Returns itself.
hide: => hide: =>
$(@element).removeClass(@options.classes.show) @currentStatus ?= Annotator.Notification.INFO
$(@element)
.removeClass(@options.classes.show)
.removeClass(@options.classes[@currentStatus])
this this
# Constants for controlling the display of the notification. Each constant # Constants for controlling the display of the notification. Each constant
......
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
/* /*
** Annotator 1.2.6-dev-af15c86 ** Annotator 1.2.6-dev-6b6cb4b
** https://github.com/okfn/annotator/ ** https://github.com/okfn/annotator/
** **
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning. ** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses. ** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE ** https://github.com/okfn/annotator/blob/master/LICENSE
** **
** Built at: 2014-04-14 22:36:40Z ** Built at: 2014-05-08 11:26:20Z
*/ */
...@@ -2330,13 +2330,17 @@ ...@@ -2330,13 +2330,17 @@
if (status == null) { if (status == null) {
status = Annotator.Notification.INFO; status = Annotator.Notification.INFO;
} }
$(this.element).addClass(this.options.classes.show).addClass(this.options.classes[status]).html(Util.escape(message || "")); this.currentStatus = status;
$(this.element).addClass(this.options.classes.show).addClass(this.options.classes[this.currentStatus]).html(Util.escape(message || ""));
setTimeout(this.hide, 5000); setTimeout(this.hide, 5000);
return this; return this;
}; };
Notification.prototype.hide = function() { Notification.prototype.hide = function() {
$(this.element).removeClass(this.options.classes.show); if (this.currentStatus == null) {
this.currentStatus = Annotator.Notification.INFO;
}
$(this.element).removeClass(this.options.classes.show).removeClass(this.options.classes[this.currentStatus]);
return this; return this;
}; };
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment