2018-06-04 00:06:17 +08:00
|
|
|
(function (global, document) {
|
2018-06-24 10:01:21 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
(document);
|
2018-06-04 00:06:17 +08:00
|
|
|
|
|
|
|
// Sets the vue.js toggle to select and deselect panes visually.
|
|
|
|
function settingSelectCSS(id) {
|
|
|
|
var data = global.dashboard.$data;
|
|
|
|
var settings = data.settings;
|
|
|
|
|
|
|
|
for (var i = 0; i < settings.length; i++) {
|
2018-09-16 07:28:08 +08:00
|
|
|
settings[i].selected = settings[i].id === id;
|
2018-06-04 00:06:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Selects a setting.
|
|
|
|
global.settingSelect = function(id) {
|
|
|
|
var data = global.dashboard.$data;
|
|
|
|
var settings = data.settings;
|
|
|
|
|
|
|
|
settingSelectCSS(id);
|
|
|
|
|
|
|
|
$("ul.tabs li").removeClass("current");
|
|
|
|
$(".content").removeClass("current");
|
|
|
|
$(".original").addClass("current");
|
|
|
|
|
|
|
|
for (var i = 0; i < settings.length; i++) {
|
2018-06-24 10:01:21 +08:00
|
|
|
if (id === settings[i].id) {
|
2018-06-04 00:06:17 +08:00
|
|
|
settings[i].open();
|
2018-06-24 10:01:21 +08:00
|
|
|
}
|
2018-06-04 00:06:17 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Deselects all settings.
|
|
|
|
global.settingDeselectAll = function() {
|
|
|
|
var data = global.dashboard.$data;
|
|
|
|
var settings = data.settings;
|
|
|
|
|
2018-06-24 10:01:21 +08:00
|
|
|
for (var i = 0; i < settings.length; i++) {
|
2018-06-04 00:06:17 +08:00
|
|
|
settings[i].selected = false;
|
2018-06-24 10:01:21 +08:00
|
|
|
}
|
2018-06-04 00:06:17 +08:00
|
|
|
}
|
|
|
|
|
2018-12-20 13:48:43 +08:00
|
|
|
} (window.commento, document));
|