Changeset 3947:3bb644edfc18
- Timestamp:
- 12/19/18 14:05:44 (7 years ago)
- Branch:
- default
- Location:
- admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/index.php
r3918 r3947 149 149 # Dashboard drag'n'drop switch for its elements 150 150 $core->auth->user_prefs->addWorkspace('accessibility'); 151 $dragndrop = ''; 151 $dragndrop = ''; 152 $dragndrop_head = ''; 153 $dragndrop_msg = [ 154 'dragndrop_off' => __('Dashboard area\'s drag and drop is disabled'), 155 'dragndrop_on' => __('Dashboard area\'s drag and drop is enabled') 156 ]; 152 157 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 153 $dragndrop = 154 '<script type="text/javascript">' . "\n" . 155 dcPage::jsVar('dotclear.dragndrop_off', __('Dashboard area\'s drag and drop is disabled')) . "\n" . 156 dcPage::jsVar('dotclear.dragndrop_on', __('Dashboard area\'s drag and drop is enabled')) . "\n" . 157 "</script>\n" . 158 '<input type="checkbox" id="dragndrop" class="sr-only" title="' . 159 __('Dashboard area\'s drag and drop is disabled') . '" />' . 158 $dragndrop_head = dcPage::jsJson('dotclear_dragndrop', $dragndrop_msg); 159 $dragndrop = 160 '<input type="checkbox" id="dragndrop" class="sr-only" title="' . $dragndrop_msg['dragndrop_off'] . '" />' . 160 161 '<label for="dragndrop">' . 161 162 '<svg aria-hidden="true" focusable="false" class="dragndrop-svg">' . 162 163 '<use xlink:href="images/dragndrop.svg#mask"></use>' . 163 164 '</svg>' . 164 '<span id="dragndrop-label" class="sr-only">' . __('Dashboard area\'s drag and drop is disabled'). '</span>' .165 '</label>';165 '<span id="dragndrop-label" class="sr-only">' . $dragndrop_msg['dragndrop_off'] . '</span>' . 166 '</label>'; 166 167 } 167 168 … … 172 173 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . 173 174 dcPage::jsLoad('js/_index.js') . 175 $dragndrop_head . 174 176 $admin_post_behavior . 175 177 # --BEHAVIOR-- adminDashboardHeaders -
admin/js/_index.js
r3936 r3947 1 /*global $, dotclear, jsToolBar */1 /*global $, dotclear, jsToolBar, getData */ 2 2 'use strict'; 3 3 … … 249 249 // Set or reset sortable depending on #dragndrop checbkox value 250 250 $('#dragndrop').click(function() { 251 Object.assign(dotclear, getData('dotclear_dragndrop')); 251 252 if ($(this).is(':checked')) { 252 253 // Activate sorting feature
Note: See TracChangeset
for help on using the changeset viewer.