Skip to content

Commit

Permalink
Added color picker js
Browse files Browse the repository at this point in the history
  • Loading branch information
gbissland committed Dec 18, 2024
1 parent a9971af commit fd63535
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generatepress-bb-color-palettes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GeneratePress Global Colour Palette for Beaver Builder
* Plugin URI: https://github.com/weavedigitalstudio/GeneratePress-BB-Color-Palettes
* Description: A custom plugin to add Beaver Builder color picker compatibility for the GeneratePress Global Color Palette.
* Version: 0.2.5
* Version: 0.2.6
* Primary Branch: main
* GitHub Plugin URI: weavedigitalstudio/GeneratePress-BB-Color-Palettes
* Author: Weave Digital Studio
Expand Down Expand Up @@ -131,7 +131,7 @@ function( $color ) {
'generatepress-color-picker',
plugin_dir_url( __FILE__ ) . 'js/gp-color-picker.js',
[ 'wp-color-picker' ],
'0.2.4', // Use plugin version for cache busting
'0.2.6', // Use plugin version for cache busting
true
);

Expand Down
20 changes: 20 additions & 0 deletions js/gp-color-picker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(function($) {
// Ensure WordPress Iris exists
if (!$.a8c || !$.a8c.iris) {
return;
}

// Extend Iris to set the GeneratePress palette globally
var originalCreate = $.a8c.iris.prototype._create;
$.a8c.iris.prototype._create = function() {
// Set the custom palette globally
if (typeof generatePressPalette !== 'undefined' && Array.isArray(generatePressPalette)) {
this.options.palettes = generatePressPalette;
}

// Call the original Iris create function
originalCreate.call(this);
};

generatePressPalette);
})(jQuery);

0 comments on commit fd63535

Please sign in to comment.