12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['jquery', '../../lib/@waca/core-client/js/core-client/ui/core/View', 'text!./templates/BreadcrumbView.html'], function ($, BaseView, Template) {
- var View = null;
- View = BaseView.extend({
- templateString: Template,
- items: null,
- events: {
- 'click .breadcrumbView a': 'tapItem'
- },
- init: function init(options) {
- View.inherited('init', this, arguments);
- this.items = options.items;
- },
- render: function render() {
- this.$el.empty();
- var sHtml = this.dotTemplate({
- items: this.items
- });
- this.$el.append(sHtml);
- },
- tapItem: function tapItem(event) {
- this._fireAction(event.currentTarget, event);
- },
- _fireAction: function _fireAction(element, event) {
- var id = $(element).data('id');
- var item = this.items[id];
- var info = {
- breadcrumbId: item.id,
- breadcrumbName: item.name,
- breadcrumbData: item.data
- };
- this.trigger('action:breadcrumb', { 'data': info, 'payload': event });
- }
- });
- return View;
- });
- //# sourceMappingURL=BreadcrumbView.js.map
|