mirror of https://github.com/ColorlibHQ/AdminLTE
Remove variables only used once.
parent
187a01a8ee
commit
e56939983d
|
@ -81,22 +81,17 @@ const CardRefresh = ($ => {
|
||||||
this._removeOverlay()
|
this._removeOverlay()
|
||||||
}, this._settings.responseType !== '' && this._settings.responseType)
|
}, this._settings.responseType !== '' && this._settings.responseType)
|
||||||
|
|
||||||
const loadedEvent = $.Event(Event.LOADED)
|
$(this._element).trigger($.Event(Event.LOADED))
|
||||||
$(this._element).trigger(loadedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_addOverlay() {
|
_addOverlay() {
|
||||||
this._parent.append(this._overlay)
|
this._parent.append(this._overlay)
|
||||||
|
$(this._element).trigger($.Event(Event.OVERLAY_ADDED))
|
||||||
const overlayAddedEvent = $.Event(Event.OVERLAY_ADDED)
|
|
||||||
$(this._element).trigger(overlayAddedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeOverlay() {
|
_removeOverlay() {
|
||||||
this._parent.find(this._overlay).remove()
|
this._parent.find(this._overlay).remove()
|
||||||
|
$(this._element).trigger($.Event(Event.OVERLAY_REMOVED))
|
||||||
const overlayRemovedEvent = $.Event(Event.OVERLAY_REMOVED)
|
|
||||||
$(this._element).trigger(overlayRemovedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
|
|
@ -76,9 +76,7 @@ const CardWidget = ($ => {
|
||||||
.addClass(this._settings.expandIcon)
|
.addClass(this._settings.expandIcon)
|
||||||
.removeClass(this._settings.collapseIcon)
|
.removeClass(this._settings.collapseIcon)
|
||||||
|
|
||||||
const collapsed = $.Event(Event.COLLAPSED)
|
this._element.trigger($.Event(Event.COLLAPSED), this._parent)
|
||||||
|
|
||||||
this._element.trigger(collapsed, this._parent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expand() {
|
expand() {
|
||||||
|
@ -91,17 +89,12 @@ const CardWidget = ($ => {
|
||||||
.addClass(this._settings.collapseIcon)
|
.addClass(this._settings.collapseIcon)
|
||||||
.removeClass(this._settings.expandIcon)
|
.removeClass(this._settings.expandIcon)
|
||||||
|
|
||||||
const expanded = $.Event(Event.EXPANDED)
|
this._element.trigger($.Event(Event.EXPANDED), this._parent)
|
||||||
|
|
||||||
this._element.trigger(expanded, this._parent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remove() {
|
remove() {
|
||||||
this._parent.slideUp()
|
this._parent.slideUp()
|
||||||
|
this._element.trigger($.Event(Event.REMOVED), this._parent)
|
||||||
const removed = $.Event(Event.REMOVED)
|
|
||||||
|
|
||||||
this._element.trigger(removed, this._parent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
|
@ -131,9 +124,7 @@ const CardWidget = ($ => {
|
||||||
$(this).dequeue()
|
$(this).dequeue()
|
||||||
})
|
})
|
||||||
|
|
||||||
const maximized = $.Event(Event.MAXIMIZED)
|
this._element.trigger($.Event(Event.MAXIMIZED), this._parent)
|
||||||
|
|
||||||
this._element.trigger(maximized, this._parent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
minimize() {
|
minimize() {
|
||||||
|
@ -156,9 +147,7 @@ const CardWidget = ($ => {
|
||||||
$(this).dequeue()
|
$(this).dequeue()
|
||||||
})
|
})
|
||||||
|
|
||||||
const MINIMIZED = $.Event(Event.MINIMIZED)
|
this._element.trigger($.Event(Event.MINIMIZED), this._parent)
|
||||||
|
|
||||||
this._element.trigger(MINIMIZED, this._parent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleMaximize() {
|
toggleMaximize() {
|
||||||
|
|
|
@ -80,8 +80,7 @@ const ControlSidebar = ($ => {
|
||||||
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
const collapsedEvent = $.Event(Event.COLLAPSED)
|
$(this._element).trigger($.Event(Event.COLLAPSED))
|
||||||
$(this._element).trigger(collapsedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
|
@ -99,8 +98,7 @@ const ControlSidebar = ($ => {
|
||||||
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
const expandedEvent = $.Event(Event.EXPANDED)
|
$(this._element).trigger($.Event(Event.EXPANDED))
|
||||||
$(this._element).trigger(expandedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
|
|
|
@ -40,9 +40,7 @@ const DirectChat = ($ => {
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
$(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN)
|
$(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN)
|
||||||
|
$(this._element).trigger($.Event(Event.TOGGLED))
|
||||||
const toggledEvent = $.Event(Event.TOGGLED)
|
|
||||||
$(this._element).trigger(toggledEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
|
@ -72,8 +72,7 @@ const PushMenu = ($ => {
|
||||||
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
|
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
const shownEvent = $.Event(Event.SHOWN)
|
$(this._element).trigger($.Event(Event.SHOWN))
|
||||||
$(this._element).trigger(shownEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
collapse() {
|
collapse() {
|
||||||
|
@ -89,8 +88,7 @@ const PushMenu = ($ => {
|
||||||
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
|
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
const collapsedEvent = $.Event(Event.COLLAPSED)
|
$(this._element).trigger($.Event(Event.COLLAPSED))
|
||||||
$(this._element).trigger(collapsedEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
|
|
|
@ -68,11 +68,9 @@ const Toasts = ($ => {
|
||||||
class Toasts {
|
class Toasts {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._config = config
|
this._config = config
|
||||||
|
|
||||||
this._prepareContainer()
|
this._prepareContainer()
|
||||||
|
|
||||||
const initEvent = $.Event(Event.INIT)
|
$('body').trigger($.Event(Event.INIT))
|
||||||
$('body').trigger(initEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public
|
// Public
|
||||||
|
@ -133,17 +131,14 @@ const Toasts = ($ => {
|
||||||
|
|
||||||
$(this._getContainerId()).prepend(toast)
|
$(this._getContainerId()).prepend(toast)
|
||||||
|
|
||||||
const createdEvent = $.Event(Event.CREATED)
|
$('body').trigger($.Event(Event.CREATED))
|
||||||
$('body').trigger(createdEvent)
|
|
||||||
|
|
||||||
toast.toast('show')
|
toast.toast('show')
|
||||||
|
|
||||||
if (this._config.autoremove) {
|
if (this._config.autoremove) {
|
||||||
toast.on('hidden.bs.toast', function () {
|
toast.on('hidden.bs.toast', function () {
|
||||||
$(this).delay(200).remove()
|
$(this).delay(200).remove()
|
||||||
|
$('body').trigger($.Event(Event.REMOVED))
|
||||||
const removedEvent = $.Event(Event.REMOVED)
|
|
||||||
$('body').trigger(removedEvent)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue