summaryrefslogtreecommitdiff
path: root/views/js/editable.js
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-09-21 10:55:51 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-09-21 10:55:51 +0000
commit24cc55213fa39bd2c2e3215943f22bef731e58fb (patch)
tree6156aa9a60ab7ab72183c274a50c39e44404e99a /views/js/editable.js
parente9cd93a5ba05b1f2b1216aba0fba86ac5977beaf (diff)
- Select im Editable zeigt gesetzten Wert
- Varianten im Frontend angezeigt und schalten Produkt um - Warnungen raus git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5767 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/js/editable.js')
-rw-r--r--views/js/editable.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/views/js/editable.js b/views/js/editable.js
index c2275ec..9717064 100644
--- a/views/js/editable.js
+++ b/views/js/editable.js
@@ -28,10 +28,23 @@
if (options.type == "select" && typeof options.data == "string")
{
+ var ar = [];
+ var arData = jQuery.parseJSON(options.data);
+ var strValue = jQuery(this).html();
+ var value = 0;
+
+ for (var i in arData)
+ {
+
+ ar.push( { 'value': i, 'text': arData[i] } );
+ if (arData[i] == strValue) value = i;
+
+ }
+
// Normale Übergabe eines JSON Strings
- opt.source = jQuery.parseJSON(options.data);
+ opt.source = ar;
opt.type = 'select';
- opt.value = options.value;
+ opt.value = value;
}
else if (options.type == 'multiarray')