port Yann's multiple-select implementation to cryptpad

This commit is contained in:
ansuz
2016-05-31 12:27:28 +02:00
parent e3b8a10959
commit d0b553d198
3 changed files with 9 additions and 1 deletions

View File

@@ -63,6 +63,13 @@
<option value="four">Four</option> <option value="four">Four</option>
</select> Dropdowns<br> </select> Dropdowns<br>
<select name="select-multiple" multiple>
<option value="pew">Pew</option>
<option value="bang">Bang</option>
<option value="kapow">Kapow</option>
<option value="zing">Zing</option>
</select>
<textarea name="textarea"></textarea><br> <textarea name="textarea"></textarea><br>
</form> </form>

View File

@@ -91,7 +91,7 @@ define([
return function (content) { return function (content) {
return typeof content !== 'undefined' ? return typeof content !== 'undefined' ?
$this.val(content): $this.val(content):
canonicalize($this.val()); typeof($this.val()) === 'string'? canonicalize($this.val()): $this.val();
}; };
} }
}()); }());

View File

@@ -17,6 +17,7 @@ define([], function () {
number: 'change', number: 'change',
range: 'keyup change', range: 'keyup change',
'select-one': 'change', 'select-one': 'change',
'select-multiple': 'change',
textarea: 'change keyup', textarea: 'change keyup',
}; };