nifty-dialog 1.0.2 → 1.0.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
  module Nifty
2
2
  module Dialog
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
@@ -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)->
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nifty-dialog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: