nifty-dialog 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/nifty/dialog/version.rb
CHANGED
@@ -39,6 +39,8 @@ window.Nifty.Dialog =
|
|
39
39
|
dialogsOpen = $('div.niftyDialog').length
|
40
40
|
dialogID = if dialogsOpen == 0 then this.startingID else (dialogsOpen * 10) + this.startingID
|
41
41
|
|
42
|
+
options.id = dialogID unless options.id?
|
43
|
+
|
42
44
|
# create a template and assign the ID
|
43
45
|
dialogTemplate = $("<div class='niftyDialog #{options.class}' id='niftyDialog-#{options.id}'></div>")
|
44
46
|
dialogTemplate.data('dialogID', dialogID)
|
@@ -131,7 +133,7 @@ window.Nifty.Dialog =
|
|
131
133
|
# This method will replace the contents of the nearest dialog (or the one with the
|
132
134
|
# given ID if one is given).
|
133
135
|
setContent: (content, id = null)->
|
134
|
-
dialog = if id == null then $('div.niftyDialog:last') else $("div.niftyDialog#
|
136
|
+
dialog = if id == null then $('div.niftyDialog:last') else $("div.niftyDialog#niftyDialog-#{id}")
|
135
137
|
if dialog.length
|
136
138
|
dialog.html(content)
|
137
139
|
options = dialog.data('options')
|
@@ -139,8 +141,10 @@ window.Nifty.Dialog =
|
|
139
141
|
behavior.onSetContent.call(null, dialog, options) if behavior.onSetContent?
|
140
142
|
this.onSetContent(null, dialog) if this.onSetContent?
|
141
143
|
|
144
|
+
# This method will refectch the contents of the nearest dialog (or the one with the
|
145
|
+
# given ID if one is given).
|
142
146
|
reloadContent: (id = null)->
|
143
|
-
dialog = if id == null then $('div.niftyDialog:last') else $("div.niftyDialog#
|
147
|
+
dialog = if id == null then $('div.niftyDialog:last') else $("div.niftyDialog#niftyDialog-#{id}")
|
144
148
|
options = dialog.data('options')
|
145
149
|
if options.url?
|
146
150
|
$.ajax
|