Permalink
Browse files

Merge branch 'master' of github.com:joshfire/joshfire-framework

  • Loading branch information...
2 parents cbed8fb + c8edfaf commit 8d476e8110b88194dddbc2897e2d13413b7a1dd8 @tbassetto tbassetto committed Nov 12, 2012
Showing with 8 additions and 4 deletions.
  1. +4 −3 lib/adapters/phone/ui/toolbar.js
  2. +4 −1 scripts/optimize.js
@@ -24,6 +24,7 @@ define(["joshlib!ui/list","joshlib!utils/dollar","joshlib!vendor/underscore"], f
this.$('.arrow').remove();
var width;
+ var itemWidth;
if(self.useWindowWidth) {
width = window.innerWidth;
@@ -35,7 +36,7 @@ define(["joshlib!ui/list","joshlib!utils/dollar","joshlib!vendor/underscore"], f
if(this.collection.length <= this.maxOnScreen) {
this.$('ul').width(width);
- var itemWidth = (width - this.margin) / this.collection.length;
+ itemWidth = (width - this.margin) / this.collection.length;
this.$('li').css({
width: itemWidth - this.margin + 'px',
@@ -47,7 +48,7 @@ define(["joshlib!ui/list","joshlib!utils/dollar","joshlib!vendor/underscore"], f
this.$('ul').css({width: numPages * width + 'px'});
- var itemWidth = Math.round((width - this.margin) / this.maxOnScreen);
+ itemWidth = Math.round((width - this.margin) / this.maxOnScreen);
var $lis = this.$('li').css({
width: itemWidth - this.margin + 'px',
@@ -56,7 +57,7 @@ define(["joshlib!ui/list","joshlib!utils/dollar","joshlib!vendor/underscore"], f
for (var i = this.maxOnScreen - 2; i < $lis.length; i += this.maxOnScreen - 2) {
if(i + 1 < $lis.length) {
- $($lis[i]).after('<li class="arrow"><a href="#" class="next">next<span></span></a></li><li class="arrow"><a href="#" class="prev">prev<span></span></a></li>');
+ $($lis[i]).after('<li class="arrow"><a class="next">next<span></span></a></li><li class="arrow"><a class="prev">prev<span></span></a></li>');
}
}
View
@@ -2,6 +2,9 @@ var fs = require("fs"),
path = require("path"),
exec = require('child_process').exec;
+// existsSync moved from "path" to "fs" in Node.js v0.8,
+// keeping the fallback so that the code remains compatible with v0.6
+var existsSync = fs.existsSync || path.existsSync;
if (process.argv.length<=2) {
console.error("Format : optimize.js adapter main");
@@ -25,7 +28,7 @@ var globalnsfile = fs.readFileSync(lib_path+"/global.js", "utf-8");
var deps = [];
-if (fs.existsSync(lib_path+"/adapters/"+adapter+"/dependencies.json")) {
+if (existsSync(lib_path+"/adapters/"+adapter+"/dependencies.json")) {
deps = JSON.parse(fs.readFileSync(lib_path+"/adapters/"+adapter+"/dependencies.json","utf-8"));
}
var adaptermodules = JSON.parse(fs.readFileSync(lib_path+"/adapters/"+adapter+"/modules.json","utf-8"));

0 comments on commit 8d476e8

Please sign in to comment.