Remove unused && improve dependencies detection

This commit is contained in:
Nicolas Le Goff
2014-02-28 00:58:14 +01:00
parent 79b4c93de5
commit af526beb41

View File

@@ -10,20 +10,19 @@
define([ define([
"jquery", "jquery",
"underscore", "underscore",
"backbone", "backbone"
""
], function ($, _, Backbone) { ], function ($, _, Backbone) {
var RefreshView = Backbone.View.extend({ var RefreshView = Backbone.View.extend({
initialize: function(options) { initialize: function(options) {
if (!"pingView" in options) { if (false === ("pingView" in options)) {
throw "You must set the ping view" throw "You must set the ping view"
} }
this.pingView = options.pingView; this.pingView = options.pingView;
if (!"scheduler" in options) { if (false === ("scheduler" in options)) {
throw "You must set the scheduler model" throw "You must set the scheduler model"
} }
this.scheduler = options.scheduler; this.scheduler = options.scheduler;
if (!"tasksCollection" in options) { if (false === ("tasksCollection" in options)) {
throw "You must set the tasks collection model" throw "You must set the tasks collection model"
} }
this.tasksCollection = options.tasksCollection; this.tasksCollection = options.tasksCollection;
@@ -38,7 +37,6 @@ define([
$.ajax({ $.ajax({
dataType: "json", dataType: "json",
url: $this.refreshUrl, url: $this.refreshUrl,
data: {},
success: function(response) { success: function(response) {
$this.pingView.render(); $this.pingView.render();
$this.scheduler.set({ $this.scheduler.set({