diff options
author | P. F. Chimento <philip.chimento@gmail.com> | 2014-05-28 09:47:33 -0600 |
---|---|---|
committer | P. F. Chimento <philip.chimento@gmail.com> | 2014-05-28 09:47:33 -0600 |
commit | 7bc2d8df736ad70fc8fb6da40e6afecc657691f0 (patch) | |
tree | f83c397c60a49bbd4bf4faddd23fd4a25b80bbd0 /wikipedia/widgets/category_selector_view.js | |
parent | 0f2082a16cc628eeecbd4837cef65e2cc31fac0e (diff) | |
parent | c2d1a64a514c70185808dafcf628a8a7cd780791 (diff) |
Merge pull request #1119 from endlessm/sdk/693
Remove Endless Wikipedia library from SDK
[endlessm/eos-sdk#693]
Diffstat (limited to 'wikipedia/widgets/category_selector_view.js')
-rw-r--r-- | wikipedia/widgets/category_selector_view.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/wikipedia/widgets/category_selector_view.js b/wikipedia/widgets/category_selector_view.js deleted file mode 100644 index 72eff07..0000000 --- a/wikipedia/widgets/category_selector_view.js +++ /dev/null @@ -1,56 +0,0 @@ -const GObject = imports.gi.GObject; -const Gtk = imports.gi.Gtk; -const Lang = imports.lang; - -const CategoryButton = imports.wikipedia.widgets.category_button; -const CategoryLayoutManager = imports.wikipedia.widgets.category_layout_manager; - -const CATEGORY_COLUMN_SPACING = 10; // pixels -const CATEGORY_ROW_SPACING = 10; // pixels - -const CategorySelectorView = new Lang.Class({ - Name: 'CategorySelectorView', - Extends: CategoryLayoutManager.CategoryLayoutManager, - Signals: { - 'category-chosen': { - param_types: [GObject.TYPE_STRING] - } - }, - - _init: function(props) { - props = props || {}; - props.column_spacing = CATEGORY_COLUMN_SPACING; - props.row_spacing = CATEGORY_ROW_SPACING; - this.parent(props); - }, - - /** - * Method: setCategories - * Create buttons in this view for a list of categories to display - * - * Parameters: - * categories - An array of <CategoryModels> - * - */ - setCategories: function(categories) { - categories.forEach(function (category) { - let button = new CategoryButton.CategoryButton({ - category_title: category.title, - image_uri: category.image_thumbnail_uri, - clickable_category: category.has_articles, - is_main_category: category.is_main_category, - }); - button.id = category.id; // ID to return to when clicked - //if the category has no articles, you shouldn't be able to click on it. - if (category.has_articles) { - button.connect('clicked', Lang.bind(this, this._onButtonClicked)); - } - - this.add(button); - }, this); - }, - - _onButtonClicked: function(button) { - this.emit('category-chosen', button.id); - } -});
\ No newline at end of file |