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.
@@ -1,5 +1,5 @@
1
1
  module Nifty
2
2
  module Dialog
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
5
5
  end
@@ -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#dialog-#{id}")
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#dialog-#{id}")
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
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.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: