nifty-dialog 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/nifty/dialog/version.rb
CHANGED
@@ -101,6 +101,13 @@ window.Nifty.Dialog =
|
|
101
101
|
console.log options
|
102
102
|
return false
|
103
103
|
|
104
|
+
ajaxLoad: (url, insertedDialog)->
|
105
|
+
insertedDialog.addClass 'ajax'
|
106
|
+
insertedDialog.addClass 'loading'
|
107
|
+
$.ajax
|
108
|
+
url: options.url
|
109
|
+
success: (data)=> this.displayDialog(insertedDialog, data)
|
110
|
+
|
104
111
|
# Add a behaviour callback which will be executed
|
105
112
|
addBehavior: (options)->
|
106
113
|
if options.name?
|
@@ -131,6 +138,14 @@ window.Nifty.Dialog =
|
|
131
138
|
if options.behavior? && behavior = this.behaviors[options.behavior]
|
132
139
|
behavior.onSetContent.call(null, dialog, options) if behavior.onSetContent?
|
133
140
|
this.onSetContent(null, dialog) if this.onSetContent?
|
141
|
+
|
142
|
+
reloadContent: (id = null)->
|
143
|
+
dialog = if id == null then $('div.niftyDialog:last') else $("div.niftyDialog#dialog-#{id}")
|
144
|
+
options = dialog.data('options')
|
145
|
+
if options.url?
|
146
|
+
$.ajax
|
147
|
+
url: options.url
|
148
|
+
success: (data)=> this.setContent(data, id)
|
134
149
|
|
135
150
|
# Create a new overlay
|
136
151
|
createOverlay: (options)->
|