File Editor
Directories:
.. (Back)
Files:
class-sinatra-customizer-control-spacing.php
spacing.css
spacing.js
spacing.min.css
spacing.min.js
Create New File
Create
Edit File: spacing.min.js
!function($){"use strict";wp.customize.controlConstructor["sinatra-spacing"]=wp.customize.Control.extend({ready:function(){var control=this;control.container.on("click",".sinatra-spacing-linked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").removeClass("linked"),$this.parent(".spacing-link-values").removeClass("unlinked")})),control.container.on("click",".sinatra-spacing-unlinked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").addClass("linked"),$this.parent(".spacing-link-values").addClass("unlinked")})),control.container.on("input",".linked input",(function(){var $val=$(this).val();$(this).closest(".spacing-input").siblings(".linked").find("input").val($val).change()})),control.container.find('.sinatra-control-unit input[type="radio"]').on("change",(function(){control.save_value()})),control.container.on("change input",".spacing-input input",(function(){control.save_value()})),control.container.find(".reset-defaults").on("click",(function(){control.container.find('input[type="number"]').each((function(){$(this).val($(this).data("default"))})),control.save_value()}))},save_value:function(){var choice,device,new_val={},devices=this.params.responsive,choices=this.params.choices,units=this.container.find(".sinatra-control-unit");if(void 0===devices||0==devices.length)for(choice in choices)new_val[choice]=this.container.find('[data-spacing-choice="'+choice+'"]').val();else for(device in devices)for(choice in new_val[device]={},choices)new_val[device][choice]=this.container.find(".control-responsive."+device+' [data-spacing-choice="'+choice+'"]').val();units.length&&(new_val.unit=units.find('input[type="radio"]:checked').val()),this.setting.set(new_val)}})}(jQuery);
Save Changes
Rename File
Rename