ultimate-flash 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  ###*
2
- * Ultimate Flash 0.8.2 - Ruby on Rails oriented jQuery plugin for smart notifications
2
+ * Ultimate Flash 0.8.3 - Ruby on Rails oriented jQuery plugin for smart notifications
3
3
  * Copyright 2011-2013 Karpunin Dmitry (KODer) / Evrone.com
4
4
  * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
5
5
  *
@@ -76,13 +76,14 @@ class Ultimate.Plugins.Flash extends Ultimate.Plugin
76
76
  jFlash = $(flash)
77
77
  jFlash.html @_prepareText(jFlash.html(), jFlash)
78
78
  @_setTimeout jFlash
79
+ jDocument = $(document)
79
80
  # binding hook ajaxError handler
80
- @$el.ajaxError =>
81
+ jDocument.ajaxError =>
81
82
  if @showAjaxErrors
82
83
  a = @_ajaxParseArguments(arguments)
83
84
  @ajaxError a.data, a.jqXHR
84
85
  # binding hook ajaxSuccess handler
85
- @$el.ajaxSuccess =>
86
+ jDocument.ajaxSuccess =>
86
87
  if @showAjaxSuccesses
87
88
  a = @_ajaxParseArguments(arguments)
88
89
  @ajaxSuccess a.data, a.jqXHR
@@ -120,16 +121,22 @@ class Ultimate.Plugins.Flash extends Ultimate.Plugin
120
121
  @hide jFlash
121
122
  , timeout
122
123
 
124
+ _hide: (jFlash, slideTime) ->
125
+ jFlash.slideUp slideTime, =>
126
+ jFlash.remove() if @_getOptionOverFlash('removeOnHide', jFlash)
127
+
123
128
  hide: (jFlashes = @jFlashes()) ->
124
129
  jFlashes.each (index, element) =>
125
130
  jFlash = $(element)
126
131
  clearTimeout jFlash.data('timeoutId')
127
- jFlash.addClass('hide').slideUp @_getOptionOverFlash('slideTime', jFlash), =>
128
- jFlash.remove() if @_getOptionOverFlash('removeOnHide', jFlash)
132
+ @_hide jFlash.addClass('hide'), @_getOptionOverFlash('slideTime', jFlash)
129
133
 
130
134
  _append: (jFlash) ->
131
135
  jFlash.appendTo @$el
132
136
 
137
+ _show: (jFlash, slideTime) ->
138
+ jFlash.slideDown slideTime
139
+
133
140
  show: (type, text, timeout = null, perFlashOptions = null) ->
134
141
  text = @_prepareText(text, perFlashOptions)
135
142
  return false if not _.isString(text) or _.string.isBlank(text)
@@ -139,9 +146,9 @@ class Ultimate.Plugins.Flash extends Ultimate.Plugin
139
146
  if excessFlashes > 0
140
147
  @hide jActiveFlashes.slice(0, excessFlashes)
141
148
  jFlash = $("<div class=\"#{@flashClass} #{type}\" style=\"display: none;\">#{text}</div>")
142
- @_append(jFlash).slideDown @_getOptionOverFlash('slideTime', perFlashOptions)
143
149
  if perFlashOptions
144
150
  jFlash.data(key, value) for key, value of perFlashOptions
151
+ @_show @_append(jFlash), @_getOptionOverFlash('slideTime', perFlashOptions)
145
152
  @_setTimeout jFlash, timeout
146
153
  jFlash
147
154
 
@@ -1,5 +1,5 @@
1
1
  module Ultimate
2
2
  module Flash
3
- VERSION = '0.8.2'
3
+ VERSION = '0.8.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultimate-flash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
12
+ date: 2013-05-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Ruby on Rails oriented jQuery plugin for smart notifications
15
15
  email: