Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b3924ea239 | ||
|
6bc2787602 | ||
|
96a6830e61 |
@@ -14,6 +14,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$.AdminLTESidebarTweak = {};
|
$.AdminLTESidebarTweak = {};
|
||||||
|
$.AdminLTESidebarTweak.Open = true;
|
||||||
|
$.AdminLTESidebarTweak.ResizeDelay = 1000;
|
||||||
|
|
||||||
$.AdminLTESidebarTweak.options = {
|
$.AdminLTESidebarTweak.options = {
|
||||||
EnableRemember: true,
|
EnableRemember: true,
|
||||||
@@ -24,6 +26,29 @@
|
|||||||
// Work out our timezone.
|
// Work out our timezone.
|
||||||
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open and close the sidebar
|
||||||
|
* @param state
|
||||||
|
* @param addclass
|
||||||
|
*/
|
||||||
|
function sidebaropenclose(state,addclass) {
|
||||||
|
// Dont do anything if the state hasnt changed.
|
||||||
|
if (state == $.AdminLTESidebarTweak.Open) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.AdminLTESidebarTweak.Open = state;
|
||||||
|
|
||||||
|
if (addclass !== 'undefined')
|
||||||
|
$("body")
|
||||||
|
.addClass(state ? 'sidebar-open' : 'sidebar-collapse');
|
||||||
|
|
||||||
|
$(this).delay($.AdminLTESidebarTweak.ResizeDelay).queue(function() {
|
||||||
|
window.dispatchEvent(new Event('resize'));
|
||||||
|
$(this).dequeue();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -31,22 +56,15 @@
|
|||||||
if($.AdminLTESidebarTweak.options.EnableRemember) {
|
if($.AdminLTESidebarTweak.options.EnableRemember) {
|
||||||
document.cookie = "toggleState=closed;path=/";
|
document.cookie = "toggleState=closed;path=/";
|
||||||
|
|
||||||
$("body").delay(500).queue(function () {
|
$("body").queue(sidebaropenclose(false));
|
||||||
window.dispatchEvent(new Event('resize'));
|
|
||||||
$(this).dequeue();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// @todo this is not firing.
|
|
||||||
$("body").on("shown.lte.pushmenu", function(){
|
$("body").on("shown.lte.pushmenu", function(){
|
||||||
if($.AdminLTESidebarTweak.options.EnableRemember){
|
if($.AdminLTESidebarTweak.options.EnableRemember){
|
||||||
document.cookie = "toggleState=opened;path=/";
|
document.cookie = "toggleState=opened;path=/";
|
||||||
|
|
||||||
$("body").delay(500).queue(function () {
|
$("body").queue(sidebaropenclose(true));
|
||||||
window.dispatchEvent(new Event('resize'));
|
|
||||||
$(this).dequeue();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -60,12 +78,7 @@
|
|||||||
$(this).removeClass('hold-transition');
|
$(this).removeClass('hold-transition');
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$("body")
|
$("body").queue(sidebaropenclose(false,true));
|
||||||
.addClass('sidebar-collapse')
|
|
||||||
.delay(500).queue(function () {
|
|
||||||
window.dispatchEvent(new Event('resize'));
|
|
||||||
$(this).dequeue();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class Carbon extends CarbonBase
|
|||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function firstOfHalf($dayOfWeek = null)
|
public function startOfHalf($dayOfWeek = null)
|
||||||
{
|
{
|
||||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
|
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ class Carbon extends CarbonBase
|
|||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function lastOfHalf($dayOfWeek = null)
|
public function endOfHalf($dayOfWeek = null)
|
||||||
{
|
{
|
||||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user