Added probing for modal dialog to prevent conflicts of more modal dialogs at same time.
This commit is contained in:
parent
a553e4c118
commit
e05c0f6064
1 changed files with 17 additions and 0 deletions
|
@ -676,6 +676,8 @@ class App.ControllerModal extends App.Controller
|
||||||
closeOnAnyClick: false
|
closeOnAnyClick: false
|
||||||
initalFormParams: {}
|
initalFormParams: {}
|
||||||
initalFormParamsIgnore: false
|
initalFormParamsIgnore: false
|
||||||
|
showTryMax: 10
|
||||||
|
showTrydelay: 1000
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'submit form': 'submit'
|
'submit form': 'submit'
|
||||||
|
@ -687,6 +689,7 @@ class App.ControllerModal extends App.Controller
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
@showTryCount = 0
|
||||||
|
|
||||||
if @authenticateRequired
|
if @authenticateRequired
|
||||||
return if !@authenticateCheckRedirect()
|
return if !@authenticateCheckRedirect()
|
||||||
|
@ -699,6 +702,16 @@ class App.ControllerModal extends App.Controller
|
||||||
if @shown
|
if @shown
|
||||||
@render()
|
@render()
|
||||||
|
|
||||||
|
showDelayed: =>
|
||||||
|
delay = =>
|
||||||
|
@showTryCount += 1
|
||||||
|
@render()
|
||||||
|
@delay(delay, @showTrydelay)
|
||||||
|
|
||||||
|
modalAlreadyExists: ->
|
||||||
|
return true if $('.modal').length > 0
|
||||||
|
false
|
||||||
|
|
||||||
content: ->
|
content: ->
|
||||||
'You need to implement a one @content()!'
|
'You need to implement a one @content()!'
|
||||||
|
|
||||||
|
@ -737,6 +750,10 @@ class App.ControllerModal extends App.Controller
|
||||||
@el
|
@el
|
||||||
|
|
||||||
render: =>
|
render: =>
|
||||||
|
if @modalAlreadyExists() && @showTryCount <= @showTryMax
|
||||||
|
@showDelayed()
|
||||||
|
return
|
||||||
|
|
||||||
@initalFormParamsIgnore = false
|
@initalFormParamsIgnore = false
|
||||||
|
|
||||||
if @buttonSubmit is true
|
if @buttonSubmit is true
|
||||||
|
|
Loading…
Reference in a new issue