|
@@ -12,9 +12,10 @@ Lungo.Notification = do(lng = Lungo) ->
|
|
|
_el = null
|
|
_el = null
|
|
|
_window = null
|
|
_window = null
|
|
|
DELAY_TIME = 1
|
|
DELAY_TIME = 1
|
|
|
- ANIMATION_MILISECONDS = 200
|
|
|
|
|
ATTRIBUTE = lng.Constants.ATTRIBUTE
|
|
ATTRIBUTE = lng.Constants.ATTRIBUTE
|
|
|
BINDING = lng.Constants.BINDING
|
|
BINDING = lng.Constants.BINDING
|
|
|
|
|
+ TRANSITION = lng.Constants.TRANSITION
|
|
|
|
|
+
|
|
|
SELECTOR =
|
|
SELECTOR =
|
|
|
BODY: "body"
|
|
BODY: "body"
|
|
|
NOTIFICATION: ".notification"
|
|
NOTIFICATION: ".notification"
|
|
@@ -30,7 +31,6 @@ Lungo.Notification = do(lng = Lungo) ->
|
|
|
WORKING: "working"
|
|
WORKING: "working"
|
|
|
INPUT: "input"
|
|
INPUT: "input"
|
|
|
|
|
|
|
|
- CALLBACK_HIDE = "Lungo.Notification.hide()"
|
|
|
|
|
MARKUP_NOTIFICATION = "<div class=\"notification\"><div class=\"window\"></div></div>"
|
|
MARKUP_NOTIFICATION = "<div class=\"notification\"><div class=\"window\"></div></div>"
|
|
|
|
|
|
|
|
###
|
|
###
|
|
@@ -52,7 +52,7 @@ Lungo.Notification = do(lng = Lungo) ->
|
|
|
_window.removeClass("show")
|
|
_window.removeClass("show")
|
|
|
setTimeout (->
|
|
setTimeout (->
|
|
|
_el.removeClass("show").removeClass("html").removeClass("confirm").removeClass("notify").removeClass "growl"
|
|
_el.removeClass("show").removeClass("html").removeClass("confirm").removeClass("notify").removeClass "growl"
|
|
|
- ), ANIMATION_MILISECONDS - 50
|
|
|
|
|
|
|
+ ), (TRANSITION.DURATION / 2)
|
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
###
|
|
@@ -108,18 +108,17 @@ Lungo.Notification = do(lng = Lungo) ->
|
|
|
setTimeout (->
|
|
setTimeout (->
|
|
|
_window.html html
|
|
_window.html html
|
|
|
_window.attr "class", "window #{stylesheet} show"
|
|
_window.attr "class", "window #{stylesheet} show"
|
|
|
- ), 400
|
|
|
|
|
|
|
+ ), (TRANSITION.DURATION / 2)
|
|
|
|
|
|
|
|
_hide = (seconds, callback) ->
|
|
_hide = (seconds, callback) ->
|
|
|
if seconds? and seconds > 0
|
|
if seconds? and seconds > 0
|
|
|
setTimeout (=>
|
|
setTimeout (=>
|
|
|
- do hide
|
|
|
|
|
- if callback then callback.call @
|
|
|
|
|
|
|
+ if callback then callback.call undefined, callback
|
|
|
), seconds * 1000
|
|
), seconds * 1000
|
|
|
|
|
|
|
|
_notify = (title, description, icon, stylesheet, seconds, callback) ->
|
|
_notify = (title, description, icon, stylesheet, seconds, callback) ->
|
|
|
_show _markup(title, description, icon), stylesheet
|
|
_show _markup(title, description, icon), stylesheet
|
|
|
- _hide seconds, callback if seconds
|
|
|
|
|
|
|
+ _hide seconds, callback
|
|
|
|
|
|
|
|
_markup = (title, description, icon) ->
|
|
_markup = (title, description, icon) ->
|
|
|
description = (if not description then " " else description)
|
|
description = (if not description then " " else description)
|