TrainSignManage/WebFrame/build/js/TodoList.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/* TodoList()
* =========
* Converts a list into a todoList.
*
* @Usage: $('.my-list').todoList(options)
* or add [data-widget="todo-list"] to the ul element
* Pass any option as data-option="value"
*/
+function ($) {
'use strict';
var DataKey = 'lte.todolist';
var Default = {
onCheck : function (item) {
return item;
},
onUnCheck: function (item) {
return item;
}
};
var Selector = {
data: '[data-widget="todo-list"]'
};
var ClassName = {
done: 'done'
};
// TodoList Class Definition
// =========================
var TodoList = function (element, options) {
this.element = element;
this.options = options;
this._setUpListeners();
};
TodoList.prototype.toggle = function (item) {
item.parents(Selector.li).first().toggleClass(ClassName.done);
if (!item.prop('checked')) {
this.unCheck(item);
return;
}
this.check(item);
};
TodoList.prototype.check = function (item) {
this.options.onCheck.call(item);
};
TodoList.prototype.unCheck = function (item) {
this.options.onUnCheck.call(item);
};
// Private
TodoList.prototype._setUpListeners = function () {
后面还有 48 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。