Making minor changes:

* Start tracking changes immediatedly depends on the handler.
* Attaching control with the filter in the NodeListByNameControl.
* Generating proper data for the NodeListByNameControl.
This commit is contained in:
Ashesh Vashi
2016-01-06 02:25:13 +05:30
parent 675e79daab
commit 456f5bc5b7
2 changed files with 8 additions and 3 deletions

View File

@@ -121,6 +121,8 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
res = [], res = [],
filter = self.field.get('filter') || function() { return true; }; filter = self.field.get('filter') || function() { return true; };
filter = filter.bind(self);
_.each(rows, function(r) { _.each(rows, function(r) {
if (filter(r)) { if (filter(r)) {
var l = (_.isFunction(node['node_label']) ? var l = (_.isFunction(node['node_label']) ?
@@ -150,6 +152,8 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
res = [], res = [],
filter = self.field.get('filter') || function() { return true; }; filter = self.field.get('filter') || function() { return true; };
filter = filter.bind(self);
_.each(rows, function(r) { _.each(rows, function(r) {
if (filter(r)) { if (filter(r)) {
var l = (_.isFunction(node['node_label']) ? var l = (_.isFunction(node['node_label']) ?
@@ -158,7 +162,7 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
image= (_.isFunction(node['node_image']) ? image= (_.isFunction(node['node_image']) ?
(node['node_image']).apply(node, [r, self.model, self]) : node.type); (node['node_image']).apply(node, [r, self.model, self]) : node.type);
res.push({ res.push({
'value': l, 'value': r.label,
'node': image, 'node': image,
'label': l 'label': l
}); });

View File

@@ -1272,7 +1272,9 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) {
self.objects = []; self.objects = [];
self.handler = (options.handler || self.handler = (options.handler ||
(self.collection && self.collection.handler)); (self.collection && self.collection.handler));
self.trackChanges = false; self.trackChanges = (
self.handler && self.handler.trackChanges
) || false;
self.onChangeData = options.onChangeData; self.onChangeData = options.onChangeData;
self.onChangeCallback = options.onChangeCallback; self.onChangeCallback = options.onChangeCallback;
@@ -1473,7 +1475,6 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) {
_.pick( _.pick(
node_info, node_info,
function(v, k, o) { function(v, k, o) {
console.log(arguments);
return (v.priority <= min_priority); return (v.priority <= min_priority);
})), })),
function(o) { return o.priority; }), function(o) { return o.priority; }),