| Index: tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
|
| diff --git a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
|
| index d5c3c99b09c7dfcec79fc1925048be15b81d1e57..38f6035415013369012fe83343efe1c17aa6b116 100644
|
| --- a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
|
| +++ b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
|
| @@ -334,15 +334,17 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| },
|
|
|
| set categories(c) {
|
| - if (!(c instanceof Array))
|
| + if (!(c instanceof Array)) {
|
| throw new Error('categories must be an array');
|
| + }
|
| this.categories_ = c;
|
|
|
| for (var i = 0; i < this.categories_.length; i++) {
|
| var split = this.categories_[i].split(',');
|
| this.categories_[i] = split.shift();
|
| - if (split.length > 0)
|
| + if (split.length > 0) {
|
| this.categories_ = this.categories_.concat(split);
|
| + }
|
| }
|
| },
|
|
|
| @@ -363,9 +365,10 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| },
|
|
|
| set currentlyChosenPreset(preset) {
|
| - if (!(preset instanceof Array))
|
| + if (!(preset instanceof Array)) {
|
| throw new Error('RecordSelectionDialog.currentlyChosenPreset:' +
|
| ' preset must be an array.');
|
| + }
|
| this.currentlyChosenPreset_ = preset;
|
|
|
| if (this.usingPreset_()) {
|
| @@ -383,10 +386,11 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| if (!this.usingPreset_()) {
|
| classList.remove('categories-column-view-hidden');
|
| } else {
|
| - if (this.editCategoriesOpened_)
|
| + if (this.editCategoriesOpened_) {
|
| classList.remove('categories-column-view-hidden');
|
| - else
|
| + } else {
|
| classList.add('categories-column-view-hidden');
|
| + }
|
| }
|
| },
|
|
|
| @@ -404,16 +408,14 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| },
|
|
|
| onClickEditCategories: function() {
|
| - if (!this.usingPreset_())
|
| - return;
|
| + if (!this.usingPreset_()) return;
|
|
|
| if (!this.editCategoriesOpened_) {
|
| this.updateCategoryColumnView_(false);
|
| for (var i = 0; i < this.currentlyChosenPreset_.length; ++i) {
|
| var categoryEl = this.querySelector('#' +
|
| this.currentlyChosenPreset_[i]);
|
| - if (!categoryEl)
|
| - continue;
|
| + if (!categoryEl) continue;
|
| categoryEl.checked = true;
|
| }
|
| }
|
| @@ -426,15 +428,15 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| changeEditCategoriesState_: function(editCategoriesState) {
|
| var presetOptionsGroup = Polymer.dom(this).querySelector(
|
| '.labeled-option-group');
|
| - if (!presetOptionsGroup)
|
| - return;
|
| + if (!presetOptionsGroup) return;
|
|
|
| this.editCategoriesOpened_ = editCategoriesState;
|
| - if (this.editCategoriesOpened_)
|
| + if (this.editCategoriesOpened_) {
|
| Polymer.dom(presetOptionsGroup).classList.add('categories-expanded');
|
| - else
|
| - Polymer.dom(presetOptionsGroup).classList.remove(
|
| - 'categories-expanded');
|
| + } else {
|
| + Polymer.dom(presetOptionsGroup).classList.remove(
|
| + 'categories-expanded');
|
| + }
|
| },
|
|
|
| updatePresetDescription_: function() {
|
| @@ -447,8 +449,9 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| } else {
|
| description.innerText = '';
|
| if (!Polymer.dom(description).classList.contains(
|
| - 'category-description-hidden'))
|
| + 'category-description-hidden')) {
|
| Polymer.dom(description).classList.add('category-description-hidden');
|
| + }
|
| }
|
| },
|
|
|
| @@ -459,11 +462,13 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| for (var category in allCategories) {
|
| var disabled = category.indexOf('disabled-by-default-') === 0;
|
| if (this.currentlyChosenPreset_.indexOf(category) >= 0) {
|
| - if (disabled)
|
| + if (disabled) {
|
| categories.push(category);
|
| + }
|
| } else {
|
| - if (!disabled)
|
| + if (!disabled) {
|
| categories.push('-' + category);
|
| + }
|
| }
|
| }
|
| return categories.join(',');
|
| @@ -476,8 +481,7 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| // Skip any category with a , as it will cause issues when we negate.
|
| // Both sides should have been added as separate categories, these can
|
| // only come from settings.
|
| - if (categories[i].match(/,/))
|
| - continue;
|
| + if (categories[i].match(/,/)) continue;
|
| negatedCategories.push('-' + categories[i]);
|
| }
|
| categories = negatedCategories.join(',');
|
| @@ -486,10 +490,12 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| disabledCategories = disabledCategories.join(',');
|
|
|
| var results = [];
|
| - if (categories !== '')
|
| + if (categories !== '') {
|
| results.push(categories);
|
| - if (disabledCategories !== '')
|
| + }
|
| + if (disabledCategories !== '') {
|
| results.push(disabledCategories);
|
| + }
|
| return results.join(',');
|
| },
|
|
|
| @@ -508,8 +514,9 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| var categories = [];
|
| for (var i = 0; i < inputsLength; ++i) {
|
| var input = inputs[i];
|
| - if (input.checked === isChecked)
|
| + if (input.checked === isChecked) {
|
| categories.push(input.value);
|
| + }
|
| }
|
| return categories;
|
| },
|
| @@ -529,8 +536,9 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| },
|
|
|
| onVisibleChange_: function() {
|
| - if (this.visible)
|
| + if (this.visible) {
|
| this.updateForm_();
|
| + }
|
| },
|
|
|
| buildInputs_: function(inputs, checkedDefault, parent) {
|
| @@ -567,8 +575,9 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| var allCategories =
|
| this.categories_.concat(tr.b.Settings.keys(this.settings_key_));
|
| var allCategoriesLength = allCategories.length;
|
| - for (var i = 0; i < allCategoriesLength; ++i)
|
| + for (var i = 0; i < allCategoriesLength; ++i) {
|
| categorySet[allCategories[i]] = true;
|
| + }
|
| return categorySet;
|
| },
|
|
|
| @@ -587,10 +596,11 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| var categories = [];
|
| var disabledCategories = [];
|
| for (var category in allCategories) {
|
| - if (category.indexOf('disabled-by-default-') === 0)
|
| + if (category.indexOf('disabled-by-default-') === 0) {
|
| disabledCategories.push(category);
|
| - else
|
| + } else {
|
| categories.push(category);
|
| + }
|
| }
|
| disabledCategories = disabledCategories.sort(ignoreCaseCompare);
|
| categories = categories.sort(ignoreCaseCompare);
|
| @@ -632,8 +642,7 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
|
| var flipInputs = function(dir) {
|
| var inputs = Polymer.dom(parent).querySelectorAll('input');
|
| for (var i = 0; i < inputs.length; i++) {
|
| - if (inputs[i].checked === dir)
|
| - continue;
|
| + if (inputs[i].checked === dir) continue;
|
| // click() is used so the settings will be correclty stored. Setting
|
| // checked does not trigger the onclick (or onchange) callback.
|
| inputs[i].click();
|
|
|