src/js/model.js
branchnew-model
changeset 880 4c7b33bf2795
parent 872 d777d05a16e4
child 881 f11b234497f7
equal deleted inserted replaced
876:03967b6ada7c 880:4c7b33bf2795
    71 }
    71 }
    72 
    72 
    73 IriSP.Model.List.prototype = new Array();
    73 IriSP.Model.List.prototype = new Array();
    74 
    74 
    75 IriSP.Model.List.prototype.getElement = function(_id) {
    75 IriSP.Model.List.prototype.getElement = function(_id) {
    76     var _index = (IriSP._(this.idIndex).indexOf(_id));
    76     var _index = (IriSP._(this.idIndex).indexOf(this.source.getNamespaced(_id).fullName));
    77     if (_index !== -1) {
    77     if (_index !== -1) {
    78         return this[_index];
    78         return this[_index];
    79     }
    79     }
    80 }
    80 }
    81 
    81 
   536         _callback.call(_this, _value, _key);
   536         _callback.call(_this, _value, _key);
   537     })
   537     })
   538 }
   538 }
   539 
   539 
   540 IriSP.Model.Source.prototype.getElement = function(_elId) {
   540 IriSP.Model.Source.prototype.getElement = function(_elId) {
   541     return this.directory.getElement(_elId);
   541     return this.directory.getElement(_this.getNamespaced(_elId).fullname);
   542 }
   542 }
   543 
   543 
   544 IriSP.Model.Source.prototype.setCurrentMediaId = function(_idRef) {
   544 IriSP.Model.Source.prototype.setCurrentMediaId = function(_idRef) {
   545     if (typeof _idRef !== "undefined") {
   545     if (typeof _idRef !== "undefined") {
   546         this.currentMedia = this.getMedias().getElement(this.getNamespaced(_idRef).fullname);
   546         this.currentMedia = this.getMedias().getElement(this.getNamespaced(_idRef).fullname);