Small modal improvements.

This commit is contained in:
Martin Edenhofer 2014-09-16 22:49:15 +02:00
parent 8f07871520
commit e35d80b183
4 changed files with 15 additions and 13 deletions

View file

@ -451,9 +451,9 @@ class App.ControllerModal extends App.Controller
backdrop: true
keyboard: true
close: true
title: '?'
head: '?'
options = _.extend( options, defaults )
options = _.extend( defaults, options )
# do not use @el, because it's inserted by js
delete options.el
@ -476,12 +476,17 @@ class App.ControllerModal extends App.Controller
)
if content
@el.find('.modal-body').html content
@el.modal('show')
@el.modal(
keyboard: @keyboard
show: true
backdrop: @backdrop
)
modalHide: (e) ->
if e
e.preventDefault()
@el.modal('hide')
@el.bind('hidden.bs.modal', =>
@onHide()
# remove modal from dom
$('.modal').remove();
)
hide: (e) ->
if e
@ -508,9 +513,6 @@ class App.ErrorModal extends App.ControllerModal
class App.SessionMessage extends App.ControllerModal
constructor: ->
super
console.log('SM', @)
@show()
# reload page on modal hidden

View file

@ -19,7 +19,7 @@ class Widget extends App.Controller
new App.SessionMessage(
head: message.head
message: message.message
keyboard: false
keyboard: true
backdrop: true
close: true
button: button

View file

@ -43,7 +43,7 @@ class Widget extends App.Controller
message: 'Session taken over... please reload page or work with other browser window.'
keyboard: false
backdrop: true
close: true
close: false
button: 'Reload application'
forceReload: true
)

View file

@ -238,7 +238,7 @@ class _webSocketSingleton extends App.Controller
# show reconnect message
@error = new App.ControllerModal(
title: 'Lost network connection!'
head: 'Lost network connection!'
message: 'Lost network connection to system, trying to reconnect...'
backdrop: false
keyboard: false