From ecfef4a560dece9dd911017efdfc63fcc04bedfc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 9 Jun 2013 16:08:59 +0200 Subject: adapted to jshint config --- module/web/app/scripts/routers/mobileRouter.js | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'module/web/app/scripts/routers/mobileRouter.js') diff --git a/module/web/app/scripts/routers/mobileRouter.js b/module/web/app/scripts/routers/mobileRouter.js index 7f1f7805e..e24cb7a34 100644 --- a/module/web/app/scripts/routers/mobileRouter.js +++ b/module/web/app/scripts/routers/mobileRouter.js @@ -1,11 +1,12 @@ -define(['jquery','backbone', 'underscore'], function($, Backbone, _){ +define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) { + 'use strict'; return Backbone.Router.extend({ - initialize: function(){ - _.bindAll(this, "changePage"); + initialize: function() { + _.bindAll(this, 'changePage'); - this.$el = $("#content"); + this.$el = $('#content'); // Tells Backbone to start watching for hashchange events Backbone.history.start(); @@ -20,27 +21,27 @@ define(['jquery','backbone', 'underscore'], function($, Backbone, _){ }, - 'home': function(){ + 'home': function() { var self = this; - $("#p1").fastClick(function(){ - self.changePage($("

Page 1


some content
sdfdsf
sdffg

oiuzz

")); + $('#p1').fastClick(function() { + self.changePage($('

Page 1


some content
sdfdsf
sdffg

oiuzz

')); }); - $("#p2").bind("click", function(){ - self.changePage($("

Page 2


some content
sdfdsf

sdfsdf

sdffg
")); + $('#p2').bind('click', function() { + self.changePage($('

Page 2


some content
sdfdsf

sdfsdf

sdffg
')); }); }, - changePage: function(content){ + changePage: function(content) { - var oldpage = this.$el.find(".page"); - content.css({x: "100%"}); + var oldpage = this.$el.find('.page'); + content.css({x: '100%'}); this.$el.append(content); - content.transition({x:0}, function(){ - window.setTimeout(function(){ + content.transition({x: 0}, function() { + window.setTimeout(function() { oldpage.remove(); }, 400); }); -- cgit v1.2.3