Author: ygrego Date: 2015-05-28 15:57:23 +0000 (Thu, 28 May 2015) New Revision: 1560 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1560 Log: Addition of the method "setCurrentChannel". Modified: oipf/js/utils/ChannelService.js Modified: oipf/js/utils/ChannelService.js =================================================================== --- oipf/js/utils/ChannelService.js 2015-05-28 15:45:48 UTC (rev 1559) +++ oipf/js/utils/ChannelService.js 2015-05-28 15:57:23 UTC (rev 1560) @@ -35,7 +35,19 @@ } } }, - + + setCurrentChannel: function(name) { + this.currentChannel = this.getChannelByName(name); + + if (this.currentChannel && this.channelList) { + var channel = this.channelList[0]; + + if (channel) { + this.currentChannel = channel; + } + } + }, + getChannelByName: function(channelCollection, channelName) { for (var i = 0, li = channelCollection.length; i < li; i++) { if (channelCollection[i].name == channelName) {