web/assets/libs/edusoho/ztree/0.0.1/select-tree.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
define(function(require, exports, module) {
require('z_tree');
require('jquery-plugin/zTree/3.5.21/css/edusohoStyle/zTreeStyle.css');
require('org_z_tree_css');
var Widget = require('widget');
var SelectTree = Widget.extend({
attrs: {
displayBlockEl: 'ztreeContent',
treeRootEl: 'orgZtree'
},
events: {
},
setup: function() {
this.inputID = $(this.element).data('inputName');
this.menuContent = this.get('displayBlockEl');
this.treeRoot = this.get('treeRootEl');
if (this.get('modal')) {
this.inputID = 'modal-' + this.inputID;
this.menuContent = 'modal-' + this.menuContent;
this.treeRoot = 'modal-' + this.treeRoot;
}
this.lastValue = this.oldValue = this.nodeList = null;
this.initDom();
this.initSelectTree();
this.zTree = this.getSelectTree();
this.initTreeEvent();
},
getSelectTree: function() {
return $.fn.zTree.getZTreeObj(this.treeRoot);
},
initDom: function() {
var sourceUrl = $(this.element).data('url');
var width = $(this.element).outerWidth(true);
var inputName = $(this.element).data('inputName');
var inputValue = $(this.element).data('inputValue');
//ztree 初始化的容器
var selectDom = "<div id='" + this.menuContent + "' class='ztreeContent' style='display:none; position: absolute; z-index: 10000;'>" +
"<ul id='" + this.treeRoot + "' class='ztree' style='margin-top:0; width:" + width + "px;z-index: 10000' data-source=" + sourceUrl + "></ul>" +
"</div>";
var selectOrgCodeDom = ' <input type ="hidden" name="' + inputName + '" id ="' + this.inputID + '" value="' +inputValue+ '" >';
$(this.element).parents('.controls').append(selectOrgCodeDom);
$(this.element).parents('.controls').append(selectDom);
},
initTreeEvent: function() {
var self = this;
$(this.element).bind("focus", this.focusKey.bind(self)).bind("blur", this.blurKey.bind(self)).bind('click input propertychange', function() {
self.zTree.expandAll(false);
self.showMenu();
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。