diff --git a/gui/slick/css/browser.css b/gui/slick/css/browser.css index 571501723e875d0280fb31342a692f3f03755fce..bdc1f3ab3ddf55f015fa8b83f32cadc944dfc2bb 100644 --- a/gui/slick/css/browser.css +++ b/gui/slick/css/browser.css @@ -1,30 +1,30 @@ -#fileBrowserDialog { +.fileBrowserDialog { max-height: 480px; overflow-y: auto; } -#fileBrowserDialog ul { +.fileBrowserDialog ul { margin: 0; padding: 0; } -#fileBrowserDialog ul li { +.fileBrowserDialog ul li { margin: 2px 0; cursor: pointer; list-style-type: none; } -#fileBrowserDialog ul li a { +.fileBrowserDialog ul li a { display: block; padding: 4px 0; } -#fileBrowserDialog ul li a:hover { +.fileBrowserDialog ul li a:hover { color: #00f; background: none; } -#fileBrowserDialog ul li a span.ui-icon { +.fileBrowserDialog ul li a .ui-icon { margin: 0 4px; float: left; } diff --git a/gui/slick/js/browser.js b/gui/slick/js/browser.js index b3a447d8159202e16541e6f0e109bd9a1ddeb43e..e9512dd67ab6fac3fa65318b74c949db901e97f3 100644 --- a/gui/slick/js/browser.js +++ b/gui/slick/js/browser.js @@ -78,7 +78,7 @@ // make a fileBrowserDialog object if one doesn't exist already if (!fileBrowserDialog) { // set up the jquery dialog - fileBrowserDialog = $('<div id="fileBrowserDialog" style="display:hidden"></div>').appendTo('body').dialog({ + fileBrowserDialog = $('<div class="fileBrowserDialog" style="display:hidden"></div>').appendTo('body').dialog({ dialogClass: 'browserDialog', title: options.title, position: { my: 'center top', at: 'center top+60', of: window }, @@ -89,30 +89,26 @@ modal: true, autoOpen: false }); - } - else { + } else { // The title may change, even if fileBrowserDialog already exists - fileBrowserDialog.dialog('option', 'title', options.title); + fileBrowserDialog.dialog('option', 'title', options.title); } - - fileBrowserDialog.dialog('option', 'buttons', [ - { - text: 'Ok', - 'class': 'btn', - click: function () { - // store the browsed path to the associated text field - callback(currentBrowserPath, options); - $(this).dialog('close'); - } - }, - { - text: 'Cancel', - 'class': 'btn', - click: function () { - $(this).dialog('close'); - } + + fileBrowserDialog.dialog('option', 'buttons', [{ + text: 'Ok', + 'class': 'btn', + click: function () { + // store the browsed path to the associated text field + callback(currentBrowserPath, options); + $(this).dialog('close'); + } + }, { + text: 'Cancel', + 'class': 'btn', + click: function () { + $(this).dialog('close'); } - ]); + }]); // set up the browser and launch the dialog var initialDir = '';