Permalink
Browse files

Add autofocus in StockAdd Panel

Signed-off-by: Wenwei Cai <stanley.w.cai@gmail.com>
  • Loading branch information...
swcai committed Mar 9, 2013
1 parent 3357ce6 commit 72a408dae9ebc1247c88c91264b3c81cb9e1ecc2
Showing with 3 additions and 92 deletions.
  1. +1 −1 README.md
  2. +1 −0 app/controllers/stocks.coffee
  3. +1 −1 app/views/stocks/add.eco
  4. +0 −30 public/application.css
  5. +0 −1 public/application.js
  6. +0 −59 test/public/specs.js
View
@@ -4,7 +4,7 @@ TODO list
- StockAdd default to active the input
- Optimize the refresh rate
- Add StockDetail Panel
-- Deploy on PhoneGap, testing on Android and Apple
+- Deploy on PhoneGap, testing on Android and Apple - Done
- Update the app Theme
- beautify the StockList panel
- code clean
@@ -25,6 +25,7 @@ class StockAdd extends Panel
render: ->
@log 'StockAdd renderred!'
@html require('views/stocks/add')()
+ $('input').focus
back: ->
@navigate('/stocks', trans: 'left')
View
@@ -1,6 +1,6 @@
<form>
<label>
<span>Code</span>
- <input type="text" name="code">
+ <input type="text" name="code" autofocus="autofocus">
</label>
</form>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,59 +0,0 @@
-
-
-(function(/*! Stitch !*/) {
- if (!this.specs) {
- var modules = {}, cache = {}, require = function(name, root) {
- var path = expand(root, name), indexPath = expand(path, './index'), module, fn;
- module = cache[path] || cache[indexPath]
- if (module) {
- return module.exports;
- } else if (fn = modules[path] || modules[path = indexPath]) {
- module = {id: path, exports: {}};
- try {
- cache[path] = module;
- fn(module.exports, function(name) {
- return require(name, dirname(path));
- }, module);
- return module.exports;
- } catch (err) {
- delete cache[path];
- throw err;
- }
- } else {
- throw 'module \'' + name + '\' not found';
- }
- }, expand = function(root, name) {
- var results = [], parts, part;
- if (/^\.\.?(\/|$)/.test(name)) {
- parts = [root, name].join('/').split('/');
- } else {
- parts = name.split('/');
- }
- for (var i = 0, length = parts.length; i < length; i++) {
- part = parts[i];
- if (part == '..') {
- results.pop();
- } else if (part != '.' && part != '') {
- results.push(part);
- }
- }
- return results.join('/');
- }, dirname = function(path) {
- return path.split('/').slice(0, -1).join('/');
- };
- this.specs = function(name) {
- return require(name, '');
- }
- this.specs.define = function(bundle) {
- for (var key in bundle)
- modules[key] = bundle[key];
- };
- this.specs.modules = modules;
- this.specs.cache = cache;
- }
- return this.specs.define;
-}).call(this)({
-
-});
-
-require('lib/setup'); for (var key in specs.modules) specs(key);

0 comments on commit 72a408d

Please sign in to comment.