Files
stf-DeviceFarmer/res/app/components/stf/common-ui/icon-inside-input/icon-inside-input-directive.js
Gunther Brunner 4edcb387d4 Added favicon resolving to URL input.
Added blur event after entering URL.
Focus screen after entering URL.
2014-07-31 20:30:43 +09:00

20 lines
513 B
JavaScript

module.exports = function iconInsideInputDirective() {
return {
restrict: 'A',
link: function (scope, element, attrs) {
// NOTE: this doesn't work on Chrome with auto-fill, known Chrome bug
element.css({
'background-repeat': 'no-repeat',
'background-position': '8px 8px',
'padding-left': '30px'
})
attrs.$observe('iconInsideInput', function(value) {
element.css({
'background-image': 'url(' + value +')'
})
})
}
}
}