1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define(['../../lib/@waca/baglass/js/baglass/app/plugins/Button', '../../app/nls/StringResources'], function (BaseClass, resources) {
- var ModeButton = BaseClass.extend({
- init: function init() {
- ModeButton.inherited('init', this, arguments);
- this.pressedTitle = resources.get('togglePreviewModeLabel');
- this.unpressedTitle = resources.get('toggleEditModeLabel');
- },
- setPressed: function setPressed() {
- ModeButton.inherited('setPressed', this, arguments);
- this.$el.attr('title', this.pressedTitle);
- this.getIcon().attr('aria-label', this.pressedTitle);
- },
- setUnpressed: function setUnpressed() {
- ModeButton.inherited('setUnpressed', this, arguments);
- this.$el.attr('title', this.unpressedTitle);
- this.getIcon().attr('aria-label', this.unpressedTitle);
- },
- getIcon: function getIcon() {
- if (!this.$icon) {
- this.$icon = this.$el.find('*[role=img],img');
- }
- return this.$icon;
- }
- });
- return ModeButton;
- });
- //# sourceMappingURL=ModeButton.js.map
|