Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/design/backend/templates/common/daterange_picker.tpl b/design/backend/templates/common/daterange_picker.tpl
index 08835f97de..653793a472 100644
--- a/design/backend/templates/common/daterange_picker.tpl
+++ b/design/backend/templates/common/daterange_picker.tpl
@@ -13,49 +13,47 @@
<script type="text/javascript" class="cm-ajax_force">
(function (_, $) {
- $(document).ready(function () {
- _.tr({
- default_lang: '{$smarty.const.DEFAULT_LANGUAGE|escape:"javascript"}',
- month_name_abr_1: '{__("month_name_abr_1")|escape:"javascript"}',
- month_name_abr_2: '{__("month_name_abr_2")|escape:"javascript"}',
- month_name_abr_3: '{__("month_name_abr_3")|escape:"javascript"}',
- month_name_abr_4: '{__("month_name_abr_4")|escape:"javascript"}',
- month_name_abr_5: '{__("month_name_abr_5")|escape:"javascript"}',
- month_name_abr_6: '{__("month_name_abr_6")|escape:"javascript"}',
- month_name_abr_7: '{__("month_name_abr_7")|escape:"javascript"}',
- month_name_abr_8: '{__("month_name_abr_8")|escape:"javascript"}',
- month_name_abr_9: '{__("month_name_abr_9")|escape:"javascript"}',
- month_name_abr_10: '{__("month_name_abr_10")|escape:"javascript"}',
- month_name_abr_11: '{__("month_name_abr_11")|escape:"javascript"}',
- month_name_abr_12: '{__("month_name_abr_12")|escape:"javascript"}',
- weekday_abr_0: '{__("weekday_abr_0")|escape:"javascript"}',
- weekday_abr_1: '{__("weekday_abr_1")|escape:"javascript"}',
- weekday_abr_2: '{__("weekday_abr_2")|escape:"javascript"}',
- weekday_abr_3: '{__("weekday_abr_3")|escape:"javascript"}',
- weekday_abr_4: '{__("weekday_abr_4")|escape:"javascript"}',
- weekday_abr_5: '{__("weekday_abr_5")|escape:"javascript"}',
- weekday_abr_6: '{__("weekday_abr_6")|escape:"javascript"}',
- today: '{__("today")|escape:"javascript"}',
- yesterday: '{__("yesterday")|escape:"javascript"}',
- this_month: '{__("this_month")|escape:"javascript"}',
- last_month: '{__("last_month")|escape:"javascript"}',
- this_year: '{__("this_year")|escape:"javascript"}',
- last_year: '{__("last_year")|escape:"javascript"}',
- custom_range: '{__("custom_range")|escape:"javascript"}',
- apply: '{__("apply")|escape:"javascript"}',
- clear: '{__("clear")|escape:"javascript"}',
- cancel: '{__("cancel")|escape:"javascript"}',
- from: '{__("from")|escape:"javascript"}',
- to: '{__("to")|escape:"javascript"}'
- });
- _.daterangepicker = {
- usePredefinedPeriods: true,
- customRangeFormat: '{if $settings.Appearance.calendar_date_format == "month_first"}MM/DD/YYYY{else}DD/MM/YYYY{/if}',
- displayedFormat: '{if $settings.Appearance.calendar_date_format == "month_first"}MMM DD, YYYY{else}DD MMM, YYYY{/if}'
- };
- _.time_from = '{$start_date|escape:"javascript"}';
- _.time_to = '{$end_date|escape:"javascript"}';
+ _.tr({
+ default_lang: '{$smarty.const.DEFAULT_LANGUAGE|escape:"javascript"}',
+ month_name_abr_1: '{__("month_name_abr_1")|escape:"javascript"}',
+ month_name_abr_2: '{__("month_name_abr_2")|escape:"javascript"}',
+ month_name_abr_3: '{__("month_name_abr_3")|escape:"javascript"}',
+ month_name_abr_4: '{__("month_name_abr_4")|escape:"javascript"}',
+ month_name_abr_5: '{__("month_name_abr_5")|escape:"javascript"}',
+ month_name_abr_6: '{__("month_name_abr_6")|escape:"javascript"}',
+ month_name_abr_7: '{__("month_name_abr_7")|escape:"javascript"}',
+ month_name_abr_8: '{__("month_name_abr_8")|escape:"javascript"}',
+ month_name_abr_9: '{__("month_name_abr_9")|escape:"javascript"}',
+ month_name_abr_10: '{__("month_name_abr_10")|escape:"javascript"}',
+ month_name_abr_11: '{__("month_name_abr_11")|escape:"javascript"}',
+ month_name_abr_12: '{__("month_name_abr_12")|escape:"javascript"}',
+ weekday_abr_0: '{__("weekday_abr_0")|escape:"javascript"}',
+ weekday_abr_1: '{__("weekday_abr_1")|escape:"javascript"}',
+ weekday_abr_2: '{__("weekday_abr_2")|escape:"javascript"}',
+ weekday_abr_3: '{__("weekday_abr_3")|escape:"javascript"}',
+ weekday_abr_4: '{__("weekday_abr_4")|escape:"javascript"}',
+ weekday_abr_5: '{__("weekday_abr_5")|escape:"javascript"}',
+ weekday_abr_6: '{__("weekday_abr_6")|escape:"javascript"}',
+ today: '{__("today")|escape:"javascript"}',
+ yesterday: '{__("yesterday")|escape:"javascript"}',
+ this_month: '{__("this_month")|escape:"javascript"}',
+ last_month: '{__("last_month")|escape:"javascript"}',
+ this_year: '{__("this_year")|escape:"javascript"}',
+ last_year: '{__("last_year")|escape:"javascript"}',
+ custom_range: '{__("custom_range")|escape:"javascript"}',
+ apply: '{__("apply")|escape:"javascript"}',
+ clear: '{__("clear")|escape:"javascript"}',
+ cancel: '{__("cancel")|escape:"javascript"}',
+ from: '{__("from")|escape:"javascript"}',
+ to: '{__("to")|escape:"javascript"}'
});
+ _.daterangepicker = {
+ usePredefinedPeriods: true,
+ customRangeFormat: '{if $settings.Appearance.calendar_date_format == "month_first"}MM/DD/YYYY{else}DD/MM/YYYY{/if}',
+ displayedFormat: '{if $settings.Appearance.calendar_date_format == "month_first"}MMM DD, YYYY{else}DD MMM, YYYY{/if}'
+ };
+ _.time_from = '{$start_date|escape:"javascript"}';
+ _.time_to = '{$end_date|escape:"javascript"}';
}(Tygh, Tygh.$));
</script>
diff --git a/js/tygh/backend/dashboard.js b/js/tygh/backend/dashboard.js
index c1280d22e2..5069a3e6c9 100644
--- a/js/tygh/backend/dashboard.js
+++ b/js/tygh/backend/dashboard.js
@@ -1,7 +1,7 @@
(function (_, $) {
$(_.doc).ready(function () {
$.ceAjax('request', fn_url('index.index'), {
- result_ids: 'dashboard_content',
+ result_ids: 'dashboard_content,actions_panel',
hidden: true
});
});
diff --git a/js/tygh/date_picker.js b/js/tygh/date_picker.js
index 601d41d973..7c322d5741 100755
--- a/js/tygh/date_picker.js
+++ b/js/tygh/date_picker.js
@@ -125,9 +125,7 @@
}
};
- //<![CDATA[
- $(document).ready(function () {
- $('.cm-date-range').ceDateRangePicker();
+ $.ceEvent('on', 'ce.commoninit', function(context) {
+ $('.cm-date-range', context).ceDateRangePicker();
});
-//]]>
}(Tygh, Tygh.$));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment