mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	refactor: remove datepicker
using datetime-local now https://github.com/NodeBB/NodeBB/blob/master/src/views/admin/partials/widget-settings.tpl#L14-L20
This commit is contained in:
		| @@ -1,7 +1,6 @@ | ||||
| @import 'jquery-ui/themes/base/core'; | ||||
| @import 'jquery-ui/themes/base/menu'; | ||||
| @import 'jquery-ui/themes/base/button'; | ||||
| @import 'jquery-ui/themes/base/datepicker'; | ||||
| @import 'jquery-ui/themes/base/autocomplete'; | ||||
| @import 'jquery-ui/themes/base/resizable'; | ||||
| @import 'jquery-ui/themes/base/selectable'; | ||||
|   | ||||
| @@ -7,7 +7,6 @@ define('admin/extend/widgets', [ | ||||
| 	'jquery-ui/widgets/sortable', | ||||
| 	'jquery-ui/widgets/draggable', | ||||
| 	'jquery-ui/widgets/droppable', | ||||
| 	'jquery-ui/widgets/datepicker', | ||||
| ], function (bootbox, alerts) { | ||||
| 	const Widgets = {}; | ||||
|  | ||||
| @@ -74,7 +73,6 @@ define('admin/extend/widgets', [ | ||||
|  | ||||
| 		$('#widgets .widget-area').sortable({ | ||||
| 			update: function (event, ui) { | ||||
| 				createDatePicker(ui.item); | ||||
| 				appendToggle(ui.item); | ||||
| 			}, | ||||
| 			start: function () { | ||||
| @@ -178,15 +176,6 @@ define('admin/extend/widgets', [ | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	function createDatePicker(el) { | ||||
| 		const currentYear = new Date().getFullYear(); | ||||
| 		el.find('.date-selector').datepicker({ | ||||
| 			changeMonth: true, | ||||
| 			changeYear: true, | ||||
| 			yearRange: currentYear + ':' + (currentYear + 100), | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	function appendToggle(el) { | ||||
| 		if (!el.hasClass('block')) { | ||||
| 			el.addClass('block').css('width', '').css('height', '') | ||||
| @@ -243,7 +232,6 @@ define('admin/extend/widgets', [ | ||||
|  | ||||
| 					widgetArea.append(populateWidget(widgetEl, widgetData.data)); | ||||
| 					appendToggle(widgetEl); | ||||
| 					createDatePicker(widgetEl); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
|   | ||||
| @@ -318,7 +318,6 @@ if (document.readyState === 'loading') { | ||||
| 			return callback(); | ||||
| 		} | ||||
| 		require([ | ||||
| 			'jquery-ui/widgets/datepicker', | ||||
| 			'jquery-ui/widgets/autocomplete', | ||||
| 			'jquery-ui/widgets/sortable', | ||||
| 			'jquery-ui/widgets/resizable', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user