Skip to content

Commit

Permalink
Item12952: compare empty strings safely; correct wizard reports; prev…
Browse files Browse the repository at this point in the history
…ent tab reload on revisit
  • Loading branch information
crawford authored and gac410 committed Sep 12, 2014
1 parent 2ded95d commit 041e29b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
18 changes: 7 additions & 11 deletions pub/System/ConfigurePlugin/configure.uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ function _id_ify(id) {

// Load the tab for a given section spec
function load_tab(spec, $panel) {
if ($panel.hasClass('spec_loaded'))
return;
RPC('getspec',
'Load: ' + spec.headline,
{
Expand All @@ -543,6 +545,7 @@ function _id_ify(id) {
$tab, $report;

$panel.append($node);
$panel.addClass('spec_loaded');

// Clean off errors and warnings that were bubbled
// up to here from higher level deep checks. We will
Expand All @@ -561,15 +564,8 @@ function _id_ify(id) {
if (spec.desc) {
$node.append('<div class="description">' + spec.desc + '</div>');
}
load_section_specs(response, $node); /*SMELL load_section_specs is not defined */
// Call to check all the *known* keys under this node. Keys
// that are currently missing from the UI (because they have
// not been loaded yet) will not be checked.
//var to_do = [];
//$node.find('.node.keyed').each(function() {
// var spec = $(this).data('spec.entry');
// to_do.push(spec.keys);
//});
load_section_specs(response, $node); /*SMELL load_section_specs is not defined yet */
// Check all the keys under this node.
RPC('check_current_value',
'Check: ' + spec.headline,
{ keys : [ spec.headline ] },
Expand Down Expand Up @@ -823,7 +819,7 @@ function _id_ify(id) {
'Study webserver',
params,
function(results) {
wizard_reports(results);
wizard_reports($root, results);
},
$root, 'check');
};
Expand All @@ -848,7 +844,7 @@ function _id_ify(id) {
'Save',
params,
function(results) {
wizard_reports(results, $root);
wizard_reports($root, results);
var erc = 0;
$.each(results.report, function(index, rep) {
if (rep.level == 'errors') {
Expand Down
7 changes: 1 addition & 6 deletions pub/System/ConfigurePlugin/types.uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var Types = {};
isModified: function() {
var cv = this.spec.current_value;
if (typeof(cv) === 'undefined') {
cv = null;
cv = (this.null_if === null) ? '' : null;
}
return this.currentValue() != cv;
},
Expand Down Expand Up @@ -157,11 +157,6 @@ var Types = {};
this.spec.SIZE = "80x20";
}
return this._super(change_handler);
},

isDefault: function() {
// String comparison, no eval
return this.currentValue() == this.spec['default'];
}
});

Expand Down

0 comments on commit 041e29b

Please sign in to comment.