Fixes +9934. Show alert when using the experimental panel

This commit is contained in:
Ruben Daniels 2015-11-12 19:56:35 +00:00
parent ff93a89502
commit d568e250e4
2 changed files with 16 additions and 6 deletions

View File

@ -1,17 +1,16 @@
define(function(require, exports, module) {
main.consumes = [
"PreferencePanel", "ui", "dialog.confirm", "settings",
"preferences", "c9"
"PreferencePanel", "ui", "dialog.alert", "settings", "c9"
];
main.provides = ["preferences.experimental"];
return main;
function main(options, imports, register) {
var PreferencePanel = imports.PreferencePanel;
var prefs = imports.preferences;
var settings = imports.settings;
var ui = imports.ui;
var c9 = imports.c9;
var alert = imports["dialog.alert"].show;
/***** Initialization *****/
@ -23,7 +22,7 @@ define(function(require, exports, module) {
var emit = plugin.getEmitter();
emit.setMaxListeners(1000);
var intro;
var intro, hasAlerted;
var loaded = false;
function load() {
@ -71,6 +70,14 @@ define(function(require, exports, module) {
}
current.type = "checkbox";
current.setting = "state/experiments/@" + uniqueId;
current.onchange = function(e){
if (!hasAlerted) {
alert("Refresh Needed",
"Please Refresh Cloud9 To Activate This Change",
"To see the effect of this change, please refresh Cloud9.");
hasAlerted = true;
}
}
if (!found[name])
plugin.add(obj, plugin);

View File

@ -190,8 +190,11 @@ define(function(require, exports, module) {
? createBind(options.path)
: (options.defaultValue || ""),
values: options.values,
skin: "cboffline"
// width: "55"
skin: "cboffline",
onafterchange: function(e) {
if (options.onchange)
options.onchange({ value: e.value });
}
})
];
break;