Skip to content

Commit

Permalink
use class for browser dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
OmgImAlexis committed Jan 10, 2016
1 parent 88e8ff5 commit 28a2671
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
12 changes: 6 additions & 6 deletions gui/slick/css/browser.css
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
40 changes: 18 additions & 22 deletions gui/slick/js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 = '';
Expand Down

0 comments on commit 28a2671

Please sign in to comment.