src/p4l/static/p4l/js/semantictree.js
changeset 111 e2ecb345b58f
parent 96 d2c4dbdf3548
child 167 7c5a09f62063
equal deleted inserted replaced
110:7a2b612ca5e0 111:e2ecb345b58f
    40         	uri = ui.item.value.match(/\(([^)]*)\)[^(]*$/)[1]
    40         	uri = ui.item.value.match(/\(([^)]*)\)[^(]*$/)[1]
    41         	// First we update the uri/label dict
    41         	// First we update the uri/label dict
    42         	angular.element(this).scope().updateUriLabelDict(uri, ui.item.label);
    42         	angular.element(this).scope().updateUriLabelDict(uri, ui.item.label);
    43         	// Angular does not listen to val() event so we update the model value manually:
    43         	// Angular does not listen to val() event so we update the model value manually:
    44             angular.element(this).controller('ngModel').$setViewValue(uri);
    44             angular.element(this).controller('ngModel').$setViewValue(uri);
       
    45             angular.element(this).scope().$apply();
    45         },
    46         },
    46         minLength: 2
    47         minLength: 2
    47     });
    48     });
    48 }
    49 }
    49 
    50 
   198 	                        	uri = uri.slice(1,-1);
   199 	                        	uri = uri.slice(1,-1);
   199 	                        	label = selected_node.data('label');
   200 	                        	label = selected_node.data('label');
   200 	                        	angular.element($('#id_'+input_name)[0]).scope().updateUriLabelDict(uri, label);
   201 	                        	angular.element($('#id_'+input_name)[0]).scope().updateUriLabelDict(uri, label);
   201 	                        	// Angular does not listen to val() event so we update the model value manually:
   202 	                        	// Angular does not listen to val() event so we update the model value manually:
   202 	                            angular.element($('#id_'+input_name)[0]).controller('ngModel').$setViewValue(uri);
   203 	                            angular.element($('#id_'+input_name)[0]).controller('ngModel').$setViewValue(uri);
       
   204 	                            angular.element($('#id_'+input_name)[0]).scope().$apply();
   203 	                            // And update the text field val
   205 	                            // And update the text field val
   204 	                        	$('#id_'+input_name).val(label + " (" + uri + ")");
   206 	                        	$('#id_'+input_name).val(label + " (" + uri + ")");
   205 	                        }
   207 	                        }
   206 	                        //$('#thesaurus_tree').data('term_tree_node',selected_node.data('term_tree_node'));
   208 	                        //$('#thesaurus_tree').data('term_tree_node',selected_node.data('term_tree_node'));
   207 	                        //$('#thesaurus_tree').val(selected_node.data('term_tree_node').id).trigger('change');                        
   209 	                        //$('#thesaurus_tree').val(selected_node.data('term_tree_node').id).trigger('change');