more refactoring and cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-08 14:43:13 +03:00
parent d885072f80
commit 01fc68ae92

View File

@ -393,10 +393,13 @@ var makeDrawer = function(direction){
options.direction = direction || 'bottom' options.direction = direction || 'bottom'
var d = drawer.Drawer( var d = drawer.Drawer(parent, dialog, options)
parent, // focus top modal on exit...
dialog, .on('close', function(){
options) var o = that.modal
o && o.focus()
})
// we need to clear other ui elements, like the status bar... // we need to clear other ui elements, like the status bar...
// XXX is this the right way to go??? // XXX is this the right way to go???
d.dom.css({ d.dom.css({
@ -434,7 +437,7 @@ var DialogsActions = actions.Actions({
// null // null
get modal(){ get modal(){
var modal = this.ribbons.viewer var modal = this.ribbons.viewer
.find('modal-widget') .find('.modal-widget')
.last() .last()
return modal.data('widget-controller') return modal.data('widget-controller')
|| (modal.length > 0 && modal) || (modal.length > 0 && modal)
@ -458,10 +461,9 @@ var DialogsActions = actions.Actions({
makeUIContainer(function(dialog, options){ makeUIContainer(function(dialog, options){
var that = this var that = this
return overlay.Overlay(this.ribbons.viewer, dialog, options) return overlay.Overlay(this.ribbons.viewer, dialog, options)
// XXX focus parent on exit... // focus top modal on exit...
.on('close', function(){ .on('close', function(){
var o = that.overlay var o = that.modal
o && o.focus() o && o.focus()
}) })
})], })],
@ -639,7 +641,7 @@ var makeActionLister = function(list, filter, pre_order){
/* /*
closingPrevented = true closingPrevented = true
// XXX need to re-render the overlay paths... // XXX need to re-render the overlay paths...
that.overlay.client that.modal.client
.pop() .pop()
*/ */
} }