vendor/assets/javascripts/webshims/shims/forms-picker.js in webshims-rails-1.14.1 vs vendor/assets/javascripts/webshims/shims/forms-picker.js in webshims-rails-1.14.3
- old
+ new
@@ -475,11 +475,11 @@
}
if (stepped) {
e.preventDefault();
}
},
- ws__input: (this.type == 'color' && this.isValid) ? $.noop : (function(){
+ ws__input: (this.type == 'color' || !this.isValid) ? $.noop : (function(){
var timer;
var delay = that.type == 'number' && !o.nogrouping ? 99 : 199;
var check = function(){
var val = that.parseValue(true);
if (val && that.isValid(val)) {
@@ -1615,11 +1615,31 @@
o.size = 1;
}
popover.actionFn = function(obj){
+ var changeChangeBehavior;
if(actions[obj['data-action']]){
+ if(obj['data-action'] == 'changeInput' && o.inlinePicker && o.updateOnInput){
+ data._handledValue = true;
+ if(o.size > 1){
+ changeChangeBehavior = $('button[value="'+obj.value+'"]', popover.bodyElement);
+ if(changeChangeBehavior.filter(':not(.othermonth)').length){
+ $('button.checked-value', popover.bodyElement).removeClass('checked-value');
+ changeChangeBehavior.addClass('checked-value').trigger('focus');
+ o.updateOnInput = false;
+ } else {
+ changeChangeBehavior = false;
+ }
+ }
+ }
actions[obj['data-action']](obj.value, popover, data, 0);
+ if(data._handledValue){
+ delete data._handledValue;
+ if(changeChangeBehavior){
+ o.updateOnInput = true;
+ }
+ }
} else {
webshims.warn('no action for '+ obj['data-action']);
}
};