Skip to content

Commit 4bac608

Browse files
committed
Remove Watch.JS and use event, triggered on theme change.
1 parent 86e422f commit 4bac608

9 files changed

Lines changed: 10 additions & 11 deletions

File tree

bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"responsive-bootstrap-toolkit": "~2.5.0",
2020
"Sortable": "~1.4.2",
2121
"tether": "~1.1.1",
22-
"tinycolor": "~1.2.1",
23-
"Watch.JS": "watch#*"
22+
"tinycolor": "~1.2.1"
2423
},
2524
"overrides": {
2625
"bootstrap": {

src/app/_common/sidebar/customize/customize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ $(function () {
6060
setThemeControlsState();
6161

6262
saveThemeSettings();
63-
64-
$(document).trigger("themechange");
6563
}
6664

6765
/************************************************
@@ -126,6 +124,8 @@ $(function () {
126124
setTimeout(function(){
127125
config.chart.colorPrimary = tinycolor($ref.find(".chart .color-primary").css("color"));
128126
config.chart.colorSecondary = tinycolor($ref.find(".chart .color-secondary").css("color"));
127+
128+
$(document).trigger("themechange");
129129
}, 200);
130130
}
131131

src/app/charts/charts-flot/charts-flot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ $(function() {
323323

324324
drawFlotCharts();
325325

326-
watch(config.chart, function(){
326+
$(document).on("themechange", function(){
327327
drawFlotCharts();
328328
});
329329

src/app/charts/charts-morris/charts-morris.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ $(function() {
119119

120120
drawMorrisCharts();
121121

122-
watch(config.chart, function(){
122+
$(document).on("themechange", function(){
123123
drawMorrisCharts();
124124
});
125125
});

src/app/dashboard/history/history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $(function() {
1818

1919
});
2020

21-
watch(config.chart, function(){
21+
$(document).on("themechange", function(){
2222
switchHistoryCharts(item);
2323
});
2424

src/app/dashboard/items/items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $(function() {
3535

3636
drawDashboardItemsListSparklines();
3737

38-
watch(config.chart, function(){
38+
$(document).on("themechange", function(){
3939
drawDashboardItemsListSparklines();
4040
});
4141
});

src/app/dashboard/sales-breakdown/sales-breakdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $(function() {
3030

3131
drawSalesChart();
3232

33-
watch(config.chart, function(){
33+
$(document).on("themechange", function(){
3434
drawSalesChart();
3535
});
3636

src/app/dashboard/sales-by-countries/sales-by-countries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $(function() {
4444

4545
drawSalesMap();
4646

47-
watch(config.chart, function(){
47+
$(document).on("themechange", function(){
4848
drawSalesMap();
4949
});
5050
});

src/app/items/list/items-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(function() {
3737

3838
drawItemsListSparklines();
3939

40-
watch(config.chart, function(){
40+
$(document).on("themechange", function(){
4141
drawItemsListSparklines();
4242
});
4343

0 commit comments

Comments
 (0)