assets/js/romo/select.js in romo-0.7.0 vs assets/js/romo/select.js in romo-0.8.0

- old
+ new

@@ -21,15 +21,18 @@ var selectedVal = this.elem.find('option[selected]').attr('value'); if (selectedVal === undefined) { selectedVal = ''; } if (selectedVal !== this.elem[0].value) { - this.romoSelectDropdown.doSetNewValue(selectedVal); - this._setNewValue(selectedVal); + this.doSetValue(selectedVal); } }, this)); + this.elem.on('select:triggerSetValue', $.proxy(function(e, value) { + this.doSetValue(value) + }, this)); + this.elem.trigger('select:ready', [this]); } RomoSelect.prototype.doInit = function() { // override as needed @@ -70,9 +73,14 @@ } RomoSelect.prototype.doRefreshUI = function() { var text = this.romoSelectDropdown.selectedListing().text() || ' '; this.romoSelectDropdown.elem.find('.romo-select-text').html(text); +} + +RomoSelect.prototype.doSetValue = function(value) { + this.romoSelectDropdown.doSetNewValue(value); + this._setNewValue(value); } RomoSelect.prototype.onCaretClick = function(e) { if (this.elem.prop('disabled') === false) { this.romoSelectDropdown.elem.focus();