Browse code

new build from home

Louis Jonget authored on18/03/2023 14:55:56
Showing1 changed files
... ...
@@ -1,33 +1,33 @@
1
-'use strict';
2
-
3
-module.exports = {
4
-  name: 'select',
5
-  template: require('../../templates/components/select.tpl'),
6
-  style: require('../../styles/clay/components/select.scss'),
7
-  manipulator: 'val',
8
-  defaults: {
9
-    label: '',
10
-    options: [],
11
-    description: '',
12
-    attributes: {}
13
-  },
14
-  initialize: function() {
15
-    var self = this;
16
-
17
-    var $value = self.$element.select('.value');
18
-
19
-    /**
20
-     * Updates the HTML value of the component to match the slected option's label
21
-     * @return {void}
22
-     */
23
-    function setValueDisplay() {
24
-      var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
25
-      var $options = self.$manipulatorTarget.select('option');
26
-      var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
27
-      $value.set('innerHTML', value);
28
-    }
29
-
30
-    setValueDisplay();
31
-    self.on('change', setValueDisplay);
32
-  }
33
-};
1
+'use strict';
2
+
3
+module.exports = {
4
+  name: 'select',
5
+  template: require('../../templates/components/select.tpl'),
6
+  style: require('../../styles/clay/components/select.scss'),
7
+  manipulator: 'val',
8
+  defaults: {
9
+    label: '',
10
+    options: [],
11
+    description: '',
12
+    attributes: {}
13
+  },
14
+  initialize: function() {
15
+    var self = this;
16
+
17
+    var $value = self.$element.select('.value');
18
+
19
+    /**
20
+     * Updates the HTML value of the component to match the slected option's label
21
+     * @return {void}
22
+     */
23
+    function setValueDisplay() {
24
+      var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
25
+      var $options = self.$manipulatorTarget.select('option');
26
+      var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
27
+      $value.set('innerHTML', value);
28
+    }
29
+
30
+    setValueDisplay();
31
+    self.on('change', setValueDisplay);
32
+  }
33
+};
Browse code

init commit

louis.jonget authored on30/09/2022 18:58:18
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+'use strict';
2
+
3
+module.exports = {
4
+  name: 'select',
5
+  template: require('../../templates/components/select.tpl'),
6
+  style: require('../../styles/clay/components/select.scss'),
7
+  manipulator: 'val',
8
+  defaults: {
9
+    label: '',
10
+    options: [],
11
+    description: '',
12
+    attributes: {}
13
+  },
14
+  initialize: function() {
15
+    var self = this;
16
+
17
+    var $value = self.$element.select('.value');
18
+
19
+    /**
20
+     * Updates the HTML value of the component to match the slected option's label
21
+     * @return {void}
22
+     */
23
+    function setValueDisplay() {
24
+      var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
25
+      var $options = self.$manipulatorTarget.select('option');
26
+      var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
27
+      $value.set('innerHTML', value);
28
+    }
29
+
30
+    setValueDisplay();
31
+    self.on('change', setValueDisplay);
32
+  }
33
+};