CoreFiles by mySites.guru
color-field-adv-init.js38 lines, 1,131 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
34316231b55084a0ed2742872f554835
sha1
c20be0a095be4f508651f96b2c93d94e1323a9a8
sha256
c76839abf95506e34e1a42d672aadcd8018fd8959437f63e1d397f9694b2703e
/**
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

!(function(document, $) {
	"use strict";

	function initMinicolorsField (event) {
		$(event.target).find('.minicolors').each(function() {
			$(this).minicolors({
				control: $(this).attr('data-control') || 'hue',
				format: $(this).attr('data-validate') === 'color'
					? 'hex'
					: ($(this).attr('data-format') === 'rgba'
					? 'rgb'
					: $(this).attr('data-format'))
					|| 'hex',
				keywords: $(this).attr('data-keywords') || '',
				opacity:  $(this).attr('data-format') === 'rgba',
				position: $(this).attr('data-position') || 'default',
				swatches: $(this).attr('data-colors') ? $(this).attr('data-colors').split(",") : [],
				theme: 'bootstrap'
			});
		});
	}

	/**
	 * Initialize at an initial page load
	 */
	document.addEventListener("DOMContentLoaded", initMinicolorsField);

	/**
	 * Initialize when a part of the page was updated
	 */
	document.addEventListener("joomla:updated", initMinicolorsField);

})(document, jQuery);

The same content is in 6 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha12. See them all, or every version of this file.