mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 05:23:21 +00:00
Add application tests
This commit is contained in:

committed by
Romain Neutron

parent
ac6c9970e2
commit
f886874f8d
@@ -5,8 +5,9 @@ define([
|
||||
], function(_, Backbone, FieldModel) {
|
||||
var FieldCollection = Backbone.Collection.extend({
|
||||
initialize: function(models, options) {
|
||||
if (!"sbas_id" in options) {
|
||||
throw "You must specify a sbasId option when creating a new field model"
|
||||
options = options || {};
|
||||
if (typeof options === "object" && false === "sbas_id" in options) {
|
||||
throw "You must set a sbas id"
|
||||
}
|
||||
this.sbasId = options.sbas_id;
|
||||
},
|
||||
@@ -20,9 +21,9 @@ define([
|
||||
|
||||
var pattern = new RegExp(letters, "gi");
|
||||
|
||||
return _(this.filter(function(data) {
|
||||
return this.filter(function(data) {
|
||||
return pattern.test(data.get("name"));
|
||||
}));
|
||||
});
|
||||
},
|
||||
comparator: function(item) {
|
||||
return item.get("sorter");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
require.config({
|
||||
baseUrl: "/scripts",
|
||||
paths: {
|
||||
jquery: "../include/minify/f=include/jslibs/jquery-1.7.1",
|
||||
jquery: "../include/jslibs/jquery-1.7.1",
|
||||
jqueryui: "../include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min",
|
||||
underscore: "../assets/underscore-amd/underscore",
|
||||
backbone: "../assets/backbone-amd/backbone",
|
||||
|
@@ -17,8 +17,8 @@ define([
|
||||
});
|
||||
|
||||
this.$el.html(template);
|
||||
|
||||
var index = $("#dces-element", AdminFieldApp.$rightBlock)[0].selectedIndex - 1;
|
||||
|
||||
var index = $("#dces-element", this.$el)[0].selectedIndex - 1;
|
||||
if (index > 0 ) {
|
||||
$(".dces-help-block", AdminFieldApp.$rightBlock).html(
|
||||
this.collection.at(index).get("definition")
|
||||
|
@@ -64,7 +64,7 @@ define([
|
||||
// scroll to current view in item list
|
||||
animate: function (top) {
|
||||
top = top || null;
|
||||
|
||||
|
||||
if (null === top) {
|
||||
top = $(".field-row").index(this.$el) * this.$el.height();
|
||||
}
|
||||
|
Reference in New Issue
Block a user