Sync plugins from current page

Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
2019-09-11 19:08:46 +02:00
parent 85d41e4216
commit 8515ff9587
1847 changed files with 505469 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
(function($, undefined){
var Field = acf.Field.extend({
type: 'range',
events: {
'input input[type="range"]': 'onChange',
'change input': 'onChange'
},
$input: function(){
return this.$('input[type="range"]');
},
$inputAlt: function(){
return this.$('input[type="number"]');
},
setValue: function( val ){
this.busy = true;
// Update range input (with change).
acf.val( this.$input(), val );
// Update alt input (without change).
// Read in input value to inherit min/max validation.
acf.val( this.$inputAlt(), this.$input().val(), true );
this.busy = false;
},
onChange: function( e, $el ){
if( !this.busy ) {
this.setValue( $el.val() );
}
}
});
acf.registerFieldType( Field );
})(jQuery);