|
@@ -102,15 +102,12 @@ ko.bindingHandlers.hivechooser = {
|
|
|
init: function(element, valueAccessor, allBindingsAccessor, vm) {
|
|
init: function(element, valueAccessor, allBindingsAccessor, vm) {
|
|
|
var self = $(element);
|
|
var self = $(element);
|
|
|
self.val(valueAccessor()());
|
|
self.val(valueAccessor()());
|
|
|
|
|
+
|
|
|
function setPathFromAutocomplete(path){
|
|
function setPathFromAutocomplete(path){
|
|
|
self.val(path);
|
|
self.val(path);
|
|
|
self.blur();
|
|
self.blur();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- self.on("blur", function(){
|
|
|
|
|
- valueAccessor()(self.val());
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
self.jHueHiveAutocomplete({
|
|
self.jHueHiveAutocomplete({
|
|
|
skipColumns: true,
|
|
skipColumns: true,
|
|
|
showOnFocus: true,
|
|
showOnFocus: true,
|
|
@@ -120,6 +117,12 @@ ko.bindingHandlers.hivechooser = {
|
|
|
},
|
|
},
|
|
|
onEnter: function (el) {
|
|
onEnter: function (el) {
|
|
|
setPathFromAutocomplete(el.val());
|
|
setPathFromAutocomplete(el.val());
|
|
|
|
|
+ },
|
|
|
|
|
+ onBlur: function () {
|
|
|
|
|
+ if (self.val().lastIndexOf(".") == self.val().length - 1){
|
|
|
|
|
+ self.val(self.val().substr(0, self.val().length - 1));
|
|
|
|
|
+ }
|
|
|
|
|
+ valueAccessor()(self.val());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|