CoreFiles by mySites.guru
color-field-adv-init.js38 lines, 1,131 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
efbd0e1f995a944fc13fc2eda6e4a6e0
sha1
232c73795d8e66ad825ce772bc738b3959c1fbb6
sha256
3a6bb6473d2b94bc378fe26c44fdbbf49a72c2f7b79129ae958b495edc66009e
/**
 * @copyright   Copyright (C) 2005 - 2020 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 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.