VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-full/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol-mobile__js__dom__MCabinetTreeNode.js
/*** module: node_modules/absol-mobile/js/dom/MCabinetTreeNode.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _Core = _interopRequireWildcard(require("./Core"));

require("../../css/mcabinetlist.css");

require("../../css/mcabinettreelist.css");

var _MCabinetItem = _interopRequireDefault(require("./MCabinetItem"));

var _noop = _interopRequireDefault(require("absol/src/Code/noop"));




/***
 * @extends AElement
 * @constructor
 */
function MCabinetTreeNode() {
  this._level = 0;
  this.$content = (0, _Core.$)('.am-cabinet-tree-node-content', this);
  this.$body = (0, _Core.$)('.am-cabinet-tree-node-body', this);
  this.$toggleCtn = (0, _Core.$)('.am-cabinet-tree-node-toggle-ctn', this);
  this.addEventListener('click', this.eventHandler.click);
  this.$quickmenuBtn = (0, _Core.$)('.am-cabinet-item-quick-menu-btn', this);

  this._makeQuickMenu();
  /***
   * @type {number}
   * @name level
   * @memberOf MCabinetTreeNode#
   */

}

MCabinetTreeNode.tag = 'MCabinetTreeNode'.toLowerCase();

MCabinetTreeNode.render = function () {
  return (0, _Core._)({
    extendEvent: ['click', 'toggle'],
    class: 'am-cabinet-tree-node',
    child: [{
      class: 'am-cabinet-tree-node-body',
      child: [{
        class: 'am-cabinet-tree-node-toggle-ctn',
        child: ['span.mdi.mdi-chevron-right']
      }, {
        class: 'am-cabinet-tree-node-content'
      }, {
        class: 'am-cabinet-tree-node-quick-menu-ctn',
        child: {
          tag: 'button',
          class: 'am-cabinet-item-quick-menu-btn',
          child: '<i class="material-icons">more_horiz</i>'
        }
      }]
    }]
  });
};

MCabinetTreeNode.prototype._makeQuickMenu = _MCabinetItem.default.prototype._makeQuickMenu;
MCabinetTreeNode.prototype.getSearchingText = _MCabinetItem.default.prototype.getSearchingText;
MCabinetTreeNode.prototype.resetView = _noop.default;
MCabinetTreeNode.property = {};
MCabinetTreeNode.property.content = _MCabinetItem.default.property.content;
MCabinetTreeNode.property.quickmenu = _MCabinetItem.default.property.quickmenu;
MCabinetTreeNode.property.level = {
  set: function (value) {
    this._level = value;
    this.$body.addStyle('--level-padding', value * 1.5 + 'em');
  },
  get: function () {
    return this._level;
  }
};
/***
 * @memberOf MCabinetTreeNode#
 * @type {{}}
 */

MCabinetTreeNode.eventHandler = {};
/***
 * @this MCabinetTreeNode
 * @param event
 */

MCabinetTreeNode.eventHandler.click = function (event) {
  var c = event.target;

  while (c) {
    if (c === this) break;

    if (c === this.$toggleCtn) {
      this.emit('toggle', {
        type: 'toggle',
        target: this,
        originalEvent: event
      }, this);
      this.opened = !this.opened;
      return;
    }

    if (c.tagName === 'INPUT') return;
    if (c.tagName === 'BUTTON') return;
    if (typeof c.checked === "boolean") return;
    if (typeof c.value !== 'undefined') return;
    if (c.isInput) return;
    c = c.parentElement;
  }

  this.emit('click', {
    type: 'click',
    target: this,
    originalEvent: event
  }, this);
};

_Core.default.install(MCabinetTreeNode);

var _default = MCabinetTreeNode;
exports.default = _default;

VaKeR 2022