Browse files

add reset method to util template

  • Loading branch information...
1 parent 93ab3f0 commit ba8b6bd45de2578e837f99b3aed1429e9e1628e1 @mmplayer mmplayer committed Mar 17, 2012
Showing with 26 additions and 0 deletions.
  1. +2 −0 src/core/log.js
  2. +24 −0 src/util/template.js
View
2 src/core/log.js
@@ -12,6 +12,8 @@
* @package core
* @module log
* @requires base
+ * @includes util.bigtable
+ * util.time
*/
QQWB.extend("log", {
View
24 src/util/template.js
@@ -41,6 +41,30 @@
},
/**
+ * Reset template
+ *
+ */
+ reset: function (resetTpl, resetData) {
+
+ if (!resetTpl && !resetData) {
+
+ this.tmpl = [];
+
+ this.datas = {};
+
+ } else {
+
+ resetTpl && (this.tmpl = []);
+
+ resetData && (this.datas = {});
+
+ }
+
+ return this;
+
+ },
+
+ /**
* Add template data
*
* Example:

0 comments on commit ba8b6bd

Please sign in to comment.