diff --git a/apps/common/main/lib/component/ComboBorderSize.js b/apps/common/main/lib/component/ComboBorderSize.js index cb970c9b9..d784d0f7a 100644 --- a/apps/common/main/lib/component/ComboBorderSize.js +++ b/apps/common/main/lib/component/ComboBorderSize.js @@ -277,8 +277,24 @@ define([ }, updateFormControl: function(record) { - $(this.el).find('.form-control > .image') - .css('background-position', '10px -' + record.get('offsety') + 'px'); + if (record) + $(this.el).find('.form-control > .image') + .css('background-position', '10px -' + record.get('offsety') + 'px').show(); + else + $(this.el).find('.form-control > .image').hide(); + }, + + setValue: function(value) { + this._selectedItem = (value===null || value===undefined) ? undefined : _.find(this.store.models, function(item) { + if ( valueitem.attributes.value-0.01) { + return true; + } + }); + + $('.selected', $(this.el)).removeClass('selected'); + + this.updateFormControl(this._selectedItem); + this._selectedItem && $('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected'); } }, Common.UI.ComboBorderType || {}));