diff options
| author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-25 21:48:40 +0200 | 
|---|---|---|
| committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-25 21:48:40 +0200 | 
| commit | 3833403178a83c5174295d945edabfe749d001af (patch) | |
| tree | 5ab919a217ef14332b068c5f7490e41c20db83c9 /web/js | |
| parent | 6e777538c411bb4abc730983c60002c330da5dab (diff) | |
front: Fix/tweak edit-box
No need to expose 'switch' id in the API - it's internal to the db.
The entire edit-logic should be cleaned up, but at least this fixes the
immediate problem.
Fixes #74
Diffstat (limited to 'web/js')
| -rw-r--r-- | web/js/nms-info-box.js | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index 8ed1f2a..9efff37 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -766,7 +766,7 @@ var switchEditPanel = function () {  			var tmpsw = '\'' + this.sw + '\'';  			var tmpv = '\'' + v + '\'';  			var tmphandler = '"nmsInfoBox._editChange(' + tmpsw + ',' + tmpv + ');"'; -			var html = '<input type="text" class="form-control" value="' + template[v] + '" id="edit-' + this.sw + '-' + v + '" onchange=' + tmphandler + ' oninput=' + tmphandler + '>'; +			var html = '<input type="text" class="form-control" value="' + template[v] + '" id="edit-' + this.sw + '-' + v + '" onchange=' + tmphandler + ' oninput=' + tmphandler + ' ' + (v == 'sysname' ? "readonly" : "") + '>';  			content.push([v, html]);  		} @@ -786,6 +786,7 @@ var switchEditPanel = function () {  		output.id = "edit-output";  		domObj.appendChild(output); +		this._render(domObj);  		if (place) {  			var pval = document.getElementById("edit-" + this.sw + "-placement");  			if (pval) { @@ -793,7 +794,6 @@ var switchEditPanel = function () {  			}  		} -		this._render(domObj);  	};  	this.save = function () {  		var myData = nmsInfoBox._editStringify(this.sw); | 
