Author: ygrego Date: 2015-02-27 16:20:55 +0000 (Fri, 27 Feb 2015) New Revision: 881 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/881 Log: This class extends from javascript class "Array". Addition of code instrumentation into method "getChannel" in order to resolve a bug of this one. Modified: oipf/js/impl/model/ChannelList.js Modified: oipf/js/impl/model/ChannelList.js =================================================================== --- oipf/js/impl/model/ChannelList.js 2015-02-25 17:07:03 UTC (rev 880) +++ oipf/js/impl/model/ChannelList.js 2015-02-27 16:20:55 UTC (rev 881) @@ -5,11 +5,10 @@ * properties and methods defined below. * */ -var ChannelList = Collection.extend({ +var ChannelList = Array.extend({ - init: function(elements) { - - this.super.init(elements); + init: function() { + this.push.apply(this, arguments); }, /* @@ -25,9 +24,12 @@ * Return: Channel */ getChannel: function(channelID) { - for (var i = 0; i < this.length; i++) { - var channel = (this)[i]; - if (channel.channelID && (channel.channelID == channelID)) { + for (var i = 0; i < this.super.length; i++) { + var channel = (this)[i]; + console.log(channel.channelId, channelID, "----------------OUT", channel); + console.log("Test", channel.channelID == channelID, channel.channelId, channelID); + if (channel.channelID == channelID) { + console.log(channel, "----------------"); return channel; } }
participants (1)
-
ygregoï¼ users.nuiton.org