-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2220 from REJack/v3-dev
further changes for v3.0.0-rc.1
- Loading branch information
Showing
809 changed files
with
135,865 additions
and
173,495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ node_modules/ | |
bower_components/ | ||
|
||
// Docs | ||
Gemfile.lock | ||
docs/_site | ||
.jekyll-cache/ | ||
.jekyll-metadata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/** | ||
* -------------------------------------------- | ||
* AdminLTE Dropdown.js | ||
* License MIT | ||
* -------------------------------------------- | ||
*/ | ||
|
||
const Dropdown = (($) => { | ||
/** | ||
* Constants | ||
* ==================================================== | ||
*/ | ||
|
||
const NAME = 'Dropdown' | ||
const DATA_KEY = 'lte.dropdown' | ||
const EVENT_KEY = `.${DATA_KEY}` | ||
const JQUERY_NO_CONFLICT = $.fn[NAME] | ||
|
||
const Selector = { | ||
DROPDOWN_MENU: 'ul.dropdown-menu', | ||
DROPDOWN_TOGGLE: '[data-toggle="dropdown"]', | ||
} | ||
|
||
const ClassName = { | ||
DROPDOWN_HOVER: '.dropdown-hover' | ||
} | ||
|
||
const Default = { | ||
} | ||
|
||
|
||
/** | ||
* Class Definition | ||
* ==================================================== | ||
*/ | ||
|
||
class Dropdown { | ||
constructor(element, config) { | ||
this._config = config | ||
this._element = element | ||
} | ||
|
||
// Public | ||
|
||
toggleSubmenu() { | ||
this._element.siblings().show().toggleClass("show"); | ||
|
||
if (! this._element.next().hasClass('show')) { | ||
this._element.parents('.dropdown-menu').first().find('.show').removeClass("show").hide(); | ||
} | ||
|
||
this._element.parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) { | ||
$('.dropdown-submenu .show').removeClass("show").hide(); | ||
}); | ||
|
||
} | ||
|
||
// Static | ||
|
||
static _jQueryInterface(config) { | ||
return this.each(function () { | ||
let data = $(this).data(DATA_KEY) | ||
const _config = $.extend({}, Default, $(this).data()) | ||
|
||
if (!data) { | ||
data = new Dropdown($(this), _config) | ||
$(this).data(DATA_KEY, data) | ||
} | ||
|
||
if (config === 'toggleSubmenu') { | ||
data[config]() | ||
} | ||
}) | ||
} | ||
} | ||
|
||
/** | ||
* Data API | ||
* ==================================================== | ||
*/ | ||
|
||
$(Selector.DROPDOWN_MENU + ' ' + Selector.DROPDOWN_TOGGLE).on("click", function(event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
|
||
Dropdown._jQueryInterface.call($(this), 'toggleSubmenu') | ||
}); | ||
|
||
// $(Selector.SIDEBAR + ' a').on('focusin', () => { | ||
// $(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED); | ||
// }) | ||
|
||
// $(Selector.SIDEBAR + ' a').on('focusout', () => { | ||
// $(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED); | ||
// }) | ||
|
||
/** | ||
* jQuery API | ||
* ==================================================== | ||
*/ | ||
|
||
$.fn[NAME] = Dropdown._jQueryInterface | ||
$.fn[NAME].Constructor = Dropdown | ||
$.fn[NAME].noConflict = function () { | ||
$.fn[NAME] = JQUERY_NO_CONFLICT | ||
return Dropdown._jQueryInterface | ||
} | ||
|
||
return Dropdown | ||
})(jQuery) | ||
|
||
export default Dropdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.