| @@ 1745-1779 (lines=35) @@ | ||
| 1742 | /* global fontAwesomeJSON */ |
|
| 1743 | wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend({ |
|
| 1744 | ||
| 1745 | initKirkiControl: function() { |
|
| 1746 | ||
| 1747 | var control = this, |
|
| 1748 | element = this.container.find( 'select' ), |
|
| 1749 | icons = jQuery.parseJSON( fontAwesomeJSON ), |
|
| 1750 | selectValue, |
|
| 1751 | selectWooOptions = { |
|
| 1752 | data: [], |
|
| 1753 | escapeMarkup: function( markup ) { |
|
| 1754 | return markup; |
|
| 1755 | }, |
|
| 1756 | templateResult: function( val ) { |
|
| 1757 | return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text; |
|
| 1758 | }, |
|
| 1759 | templateSelection: function( val ) { |
|
| 1760 | return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text; |
|
| 1761 | } |
|
| 1762 | }, |
|
| 1763 | select; |
|
| 1764 | ||
| 1765 | _.each( icons.icons, function( icon ) { |
|
| 1766 | selectWooOptions.data.push({ |
|
| 1767 | id: icon.id, |
|
| 1768 | text: icon.name |
|
| 1769 | }); |
|
| 1770 | }); |
|
| 1771 | ||
| 1772 | select = jQuery( element ).selectWoo( selectWooOptions ); |
|
| 1773 | ||
| 1774 | select.on( 'change', function() { |
|
| 1775 | selectValue = jQuery( this ).val(); |
|
| 1776 | control.setting.set( selectValue ); |
|
| 1777 | }); |
|
| 1778 | select.val( control.setting._value ).trigger( 'change' ); |
|
| 1779 | } |
|
| 1780 | }); |
|
| 1781 | /* global kirkiControlLoader */ |
|
| 1782 | wp.customize.controlConstructor['kirki-image'] = wp.customize.Control.extend({ |
|
| @@ 1718-1752 (lines=35) @@ | ||
| 1715 | /* global fontAwesomeJSON */ |
|
| 1716 | wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend({ |
|
| 1717 | ||
| 1718 | initKirkiControl: function() { |
|
| 1719 | ||
| 1720 | var control = this, |
|
| 1721 | element = this.container.find( 'select' ), |
|
| 1722 | icons = jQuery.parseJSON( fontAwesomeJSON ), |
|
| 1723 | selectValue, |
|
| 1724 | selectWooOptions = { |
|
| 1725 | data: [], |
|
| 1726 | escapeMarkup: function( markup ) { |
|
| 1727 | return markup; |
|
| 1728 | }, |
|
| 1729 | templateResult: function( val ) { |
|
| 1730 | return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text; |
|
| 1731 | }, |
|
| 1732 | templateSelection: function( val ) { |
|
| 1733 | return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text; |
|
| 1734 | } |
|
| 1735 | }, |
|
| 1736 | select; |
|
| 1737 | ||
| 1738 | _.each( icons.icons, function( icon ) { |
|
| 1739 | selectWooOptions.data.push({ |
|
| 1740 | id: icon.id, |
|
| 1741 | text: icon.name |
|
| 1742 | }); |
|
| 1743 | }); |
|
| 1744 | ||
| 1745 | select = jQuery( element ).selectWoo( selectWooOptions ); |
|
| 1746 | ||
| 1747 | select.on( 'change', function() { |
|
| 1748 | selectValue = jQuery( this ).val(); |
|
| 1749 | control.setting.set( selectValue ); |
|
| 1750 | }); |
|
| 1751 | select.val( control.setting._value ).trigger( 'change' ); |
|
| 1752 | } |
|
| 1753 | }); |
|
| 1754 | /* global kirkiControlLoader */ |
|
| 1755 | wp.customize.controlConstructor['kirki-image'] = wp.customize.Control.extend({ |
|