From 36c995018de18ee945571fb084ef4cb13fa26d1c Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 4 Jan 2016 23:32:43 -0700 Subject: [PATCH] Add getCount() and getItems9) --- core/menu_view.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/menu_view.js b/core/menu_view.js index 4ad4c977..cf2aabd1 100644 --- a/core/menu_view.js +++ b/core/menu_view.js @@ -68,6 +68,16 @@ MenuView.prototype.setItems = function(items) { } }; +MenuView.prototype.getCount = function() { + return this.items.length; +}; + +MenuView.prototype.getItems = function() { + return _.map(this.items, function itemIter(i) { + return i.text; + }); +}; + MenuView.prototype.getItem = function(index) { return this.items[index].text; };