3c1a9693 by Adam Heath

No longer require backbone-seen, instead the seen-ness of the path is

managed as part of holder.
1 parent ca62b8b1
......@@ -14,7 +14,6 @@
"src/lib"
],
"dependencies": {
"backbone-seen": "git@gitlab.brainfood.com:brainfood/backbone-seen.git",
"backbone": "",
"backbone-validation": "",
"jquery": "",
......
......@@ -28,8 +28,7 @@ require = (function() {
rivets: '../lib/rivets/dist/rivets',
bootstrap: '../lib/bootstrap/dist/js/bootstrap',
jquery: '../lib/jquery/dist/jquery',
'rivets-backbone-adapter': '../lib/rivets-backbone-adapter/rivets-backbone',
'backbone-seen': '../lib/backbone-seen/src/scripts/backbone-seen'
'rivets-backbone-adapter': '../lib/rivets-backbone-adapter/rivets-backbone'
}
};
......
......@@ -38,12 +38,13 @@ define(function(require) {
var holder = this.validationHolder = {
//marker: el.parentNode.insertBefore(document.createComment(" rivets: " + this.type + " "), el),
observer: observer,
seen: {},
focus: function() {
render(el, 'focus', false);
},
blur: function() {
if (observer.target) {
observer.target.seen(observer.key.path, true);
holder.seen[observer.key.path] = true;
}
render(el, 'blur', false);
if (observer.target) {
......@@ -52,7 +53,7 @@ define(function(require) {
},
validated: function(isValid, model, errors) {
var errorList = errors[observer.key.path];
if (errorList && observer.target && observer.target.seen(holder.observer.key.path)) {
if (errorList && observer.target && holder.seen[holder.observer.key.path]) {
render(el, 'validated', errorList);
} else {
render(el, 'validated', false);
......
......@@ -8,7 +8,6 @@ define(function(require) {
var Backbone = require('backbone');
var rivets = require('rivets');
require('backbone-validation');
var BackboneSeen = require('backbone-seen');
require('rivets-backbone-adapter');
_.extend(Backbone.Model.prototype, Backbone.Validation.mixin);
//rivets.config.rootInterface = ':';
......@@ -47,7 +46,7 @@ define(function(require) {
render.counts = {focus: 0, blur: 0, validatedError: 0, validatedClean: 0};
jasmine.Clock.useMock();
Model = BackboneSeen.mixin(Backbone.Model.extend());
Model = Backbone.Model.extend();
Collection = Backbone.Collection.extend({model: Model});
scope = new Model({
......