mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 06:38:14 +01:00
- Fix build asset fails
This commit is contained in:
parent
76ac6ec566
commit
0949dd33b5
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
humhub.module('ui.panel', function(module, require, $) {
|
humhub.module('ui.panel', function(module, require, $) {
|
||||||
|
|
||||||
let Widget = require('ui.widget').Widget;
|
var Widget = require('ui.widget').Widget;
|
||||||
|
|
||||||
let PanelMenu = Widget.extend();
|
var PanelMenu = Widget.extend();
|
||||||
|
|
||||||
let STATE_COLLAPSED = 'collapsed';
|
var STATE_COLLAPSED = 'collapsed';
|
||||||
|
|
||||||
PanelMenu.prototype.init = function() {
|
PanelMenu.prototype.init = function() {
|
||||||
this.$panel = this.$.closest('.panel');
|
this.$panel = this.$.closest('.panel');
|
||||||
@ -31,22 +31,22 @@ humhub.module('ui.panel', function(module, require, $) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PanelMenu.prototype.getKey = function() {
|
PanelMenu.prototype.getKey = function() {
|
||||||
let panelId = this.$panel.attr('id');
|
var panelId = this.$panel.attr('id');
|
||||||
return (!panelId || !panelId.length) ? null : 'pm_'+this.$panel.attr('id');
|
return (!panelId || !panelId.length) ? null : 'pm_'+this.$panel.attr('id');
|
||||||
};
|
};
|
||||||
|
|
||||||
PanelMenu.prototype.checkToggleLinkState = function() {
|
PanelMenu.prototype.checkToggleLinkState = function() {
|
||||||
let isCollapsed = this.$body.is(':visible');
|
var isCollapsed = this.$body.is(':visible');
|
||||||
|
|
||||||
let icon = (isCollapsed)
|
var icon = (isCollapsed)
|
||||||
? module.config.icon.up
|
? module.config.icon.up
|
||||||
: module.config.icon.down;
|
: module.config.icon.down;
|
||||||
|
|
||||||
let text = (isCollapsed)
|
var text = (isCollapsed)
|
||||||
? module.text('collapse')
|
? module.text('collapse')
|
||||||
: module.text('expand');
|
: module.text('expand');
|
||||||
|
|
||||||
let $collapseLink = this.$.find('.panel-collapse').html( icon + ' ' + text);
|
var $collapseLink = this.$.find('.panel-collapse').html( icon + ' ' + text);
|
||||||
|
|
||||||
if(isCollapsed) {
|
if(isCollapsed) {
|
||||||
$collapseLink.addClass('panel-collapsed');
|
$collapseLink.addClass('panel-collapsed');
|
||||||
@ -56,7 +56,7 @@ humhub.module('ui.panel', function(module, require, $) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PanelMenu.prototype.toggle = function(evt) {
|
PanelMenu.prototype.toggle = function(evt) {
|
||||||
let that = this;
|
var that = this;
|
||||||
if(this.$body.is(':visible')) {
|
if(this.$body.is(':visible')) {
|
||||||
this.$body.slideUp("fast", function () {
|
this.$body.slideUp("fast", function () {
|
||||||
localStorage.setItem(that.getKey(), STATE_COLLAPSED);
|
localStorage.setItem(that.getKey(), STATE_COLLAPSED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user