diff --git a/static/js/findDialog.js b/static/js/findDialog.js index 944eeab..ce4bda5 100644 --- a/static/js/findDialog.js +++ b/static/js/findDialog.js @@ -4,34 +4,39 @@ oml.ui.findDialog = function() { var ui = oml.user.ui, - that = Ox.Dialog({ - buttons: [ - Ox.Button({ - id: 'done', - style: 'squared', - title: Ox._('Done') - }) - .bindEvent({ - click: function() { - var list = oml.$ui.findForm.getList(); - if (list.save) { - oml.addList({ - name: list.name, - query: list.query - }); + that = Ox.Dialog({ + buttons: [ + Ox.Button({ + id: 'done', + style: 'squared', + title: Ox._('Done') + }) + .bindEvent({ + click: function() { + var list = oml.$ui.findForm.getList(); + if (list.save) { + oml.addList({ + name: list.name, + query: list.query + }); + } + that.close(); } - that.close() - } - }) - ], - closeButton: true, - content: oml.$ui.findForm = oml.ui.findForm().css({margin: '16px'}), - fixedSize: true, - height: 264, - removeOnClose: true, - title: Ox._('Advanced Find'), - width: 648 + Ox.UI.SCROLLBAR_SIZE - }), + }) + ], + closeButton: true, + content: oml.$ui.findForm = oml.ui.findForm().css({margin: '16px'}), + fixedSize: true, + height: 264, + removeOnClose: true, + title: Ox._('Advanced Find'), + width: 648 + Ox.UI.SCROLLBAR_SIZE + }) + .bindEvent({ + close: function() { + // ... + } + }), $updateCheckbox = Ox.Checkbox({ style: 'squared', diff --git a/static/js/findElement.js b/static/js/findElement.js index dba8cb9..1d0a29b 100644 --- a/static/js/findElement.js +++ b/static/js/findElement.js @@ -9,13 +9,13 @@ oml.ui.findElement = function() { hasPressedClear = false, previousFindKey = findKey, - that = Ox.FormElementGroup({ + that = Ox.FormElementGroup({ - elements: [ + elements: [ - oml.$ui.findInSelect = renderFindInSelect(), + oml.$ui.findInSelect = renderFindInSelect(), - oml.$ui.findSelect = Ox.Select({ + oml.$ui.findSelect = Ox.Select({ id: 'select', items: [].concat( oml.config.findKeys.map(function(key) { diff --git a/static/js/findForm.js b/static/js/findForm.js index 69715bb..db14d91 100644 --- a/static/js/findForm.js +++ b/static/js/findForm.js @@ -41,22 +41,17 @@ oml.ui.findForm = function(list) { query: data.value } : {}, function(result) { if (list || ui.updateResults) { - updateResults(); + if (!list) { + oml.UI.set({find: Ox.clone(data.value, true)}); + oml.$ui.findElement.updateElement(); + } + oml.reloadLists(); } }); } }) .appendTo(that); - function updateResults() { - if (list || ui.updateResults) { - oml.reloadLists(); - } else { - oml.UI.set({find: Ox.clone($filter.options('value'), true)}); - oml.$ui.findElement.updateElement(); - } - } - that.getList = $filter.getList; that.value = $filter.value; diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index 552d09a..d1fb1b7 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -478,7 +478,10 @@ oml.ui.mainMenu = function() { (oml.$ui.titlesDialog || ( oml.$ui.titlesDialog = oml.ui.titlesDialog() )).open(); + } else if (id == 'advancedfind') { + oml.$ui.findDialog = oml.ui.findDialog().open(); } else if (id == 'download') { + // FIXME: what is this?? if (oml.user.ui.item) { document.location.href = '/' + oml.user.ui.item + '/get/'; } else { @@ -568,7 +571,7 @@ oml.ui.mainMenu = function() { oml.$ui.findInput.focusInput(true); }); } else { - oml.$ui.filterDialog = oml.ui.filterDialog().open(); + oml.$ui.findDialog = oml.ui.findDialog().open(); } } }, @@ -578,7 +581,9 @@ oml.ui.mainMenu = function() { } }, key_control_shift_f: function() { - Ox.print('FIXME: NOT IMPLEMENTED') + if (!oml.hasDialogOrScreen()) { + oml.$ui.findDialog = oml.ui.findDialog().open(); + } }, key_control_shift_w: function() { if (!oml.hasDialogOrScreen()) {