Evan You 13 سال پیش
والد
کامیت
3c5464c0aa
5فایلهای تغییر یافته به همراه20 افزوده شده و 9 حذف شده
  1. 1 1
      bower.json
  2. 1 1
      component.json
  3. 17 6
      dist/seed.js
  4. 0 0
      dist/seed.min.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "seed",
-    "version": "0.1.5",
+    "version": "0.1.6",
     "main": "dist/seed.js",
     "ignore": [
         ".*",

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "seed",
-    "version": "0.1.5",
+    "version": "0.1.6",
     "main": "src/main.js",
     "scripts": [
         "src/main.js",

+ 17 - 6
dist/seed.js

@@ -760,7 +760,7 @@ SeedProto._compileTextNode = function (node) {
         el, token, directive
     for (var i = 0, l = tokens.length; i < l; i++) {
         token = tokens[i]
-        el = document.createTextNode()
+        el = document.createTextNode('')
         if (token.key) {
             directive = DirectiveParser.parse(dirname, token.key)
             if (directive) {
@@ -936,6 +936,15 @@ ScopeProto.$unwatch = function (key) {
     }, 0)
 }
 
+/*
+ *  load data into scope
+ */
+ScopeProto.$load = function (data) {
+    for (var key in data) {
+        this[key] = data[key]
+    }
+}
+
 /*
  *  Dump a copy of current scope data, excluding seed-exposed properties.
  *  @param key (optional): key for the value to dump
@@ -1488,7 +1497,9 @@ module.exports = {
     },
 
     pluralize: function (value, args) {
-        return value === 1 ? args[0] : (args[1] || args[0] + 's')
+        return args.length > 1
+            ? (args[value - 1] || args[args.length - 1])
+            : (args[value - 1] || args[0] + 's')
     },
 
     currency: function (value, args) {
@@ -1548,7 +1559,7 @@ module.exports = {
     focus: function (value) {
         var el = this.el
         setTimeout(function () {
-            el[value ? 'focus' : 'blur']()
+            el[value ? 'focus' : 'focus']()
         }, 0)
     },
 
@@ -1571,14 +1582,14 @@ module.exports = {
             this.change = function () {
                 self.seed.scope[self.key] = el.value
             }
-            el.addEventListener('change', this.change)
+            el.addEventListener('keyup', this.change)
         },
         update: function (value) {
             this.el.value = value ? value : ''
         },
         unbind: function () {
             if (this.oneway) return
-            this.el.removeEventListener('change', this.change)
+            this.el.removeEventListener('keyup', this.change)
         }
     },
 
@@ -1871,5 +1882,5 @@ require.alias("component-indexof/index.js", "component-emitter/deps/indexof/inde
 require.alias("seed/src/main.js", "seed/index.js");
 
 window.Seed = window.Seed || require('seed')
-Seed.version = '0.1.5'
+Seed.version = '0.1.6'
 })();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/seed.min.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "seed",
-    "version": "0.1.5",
+    "version": "0.1.6",
     "devDependencies": {
         "grunt": "~0.4.1",
         "grunt-contrib-watch": "~0.4.4",

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است