Skip to content

Commit

Permalink
Move Chart and Color from the global scope to window.imagify at…
Browse files Browse the repository at this point in the history
…tributes.

It will prevent conflicts with page builders that also use `Color`, and plugins that use outdated copies of chart.js (`Chart`).
  • Loading branch information
Screenfeed committed Jan 11, 2018
1 parent 759e0b0 commit 4eb346b
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 172 deletions.
6 changes: 4 additions & 2 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
window.imagify = {
window.imagify = window.imagify || {};

jQuery.extend( window.imagify, {
concat: ajaxurl.indexOf( '?' ) > 0 ? '&' : '?',
log: function( content ) {
if ( undefined !== console ) {
Expand All @@ -20,7 +22,7 @@ window.imagify = {

jQuery( 'body' ).addClass( 'imagify-modal-is-open' );
}
};
} );


// Imagify light modal =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions assets/js/bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
return;
}

donuts[ this.id ] = new Chart( this, {
donuts[ this.id ] = new w.imagify.Chart( this, {
type: 'doughnut',
data: {
datasets: [{
Expand Down Expand Up @@ -91,7 +91,7 @@
return;
}

donut = new Chart( this, {
donut = new w.imagify.Chart( this, {
type: 'doughnut',
data: {
datasets: [{
Expand Down Expand Up @@ -121,7 +121,7 @@
}

if ( overviewCanvas ) {
overviewDoughnut = new Chart( overviewCanvas, {
overviewDoughnut = new w.imagify.Chart( overviewCanvas, {
type: 'doughnut',
data: overviewData,
options: {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/bulk.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4eb346b

Please sign in to comment.