Sha256: c62dea935696aad3286ce462da779b849ddf286b16474601645cbb14c5a76f83
Contents?: true
Size: 1.13 KB
Versions: 3
Compression:
Stored size: 1.13 KB
Contents
/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['./SemanticButton','sap/m/library',"sap/ui/events/KeyCodes"],function(S,m,K){"use strict";var B=m.ButtonType;var a=S.extend("sap.f.semantic.SemanticToggleButton",{metadata:{library:"sap.f","abstract":true,properties:{pressed:{type:"boolean",group:"Data",defaultValue:false}}}});a.prototype._onTap=function(e){e.setMarked();if(this.getEnabled()){this.setPressed(!this.getPressed());this.firePress({pressed:this.getPressed()});}};a.prototype._onKeydown=function(e){if(e.which===K.SPACE||e.which===K.ENTER){this._onTap(e);}};a.prototype._applyProperty=function(p,v,s){if(p==='pressed'){this._setPressed(v,s);}else{S.prototype._applyProperty.apply(this,arguments);}};a.prototype._setPressed=function(p,s){var b=p?B.Emphasized:B.Transparent;this._getControl().setType(b,s);};a.prototype._createInstance=function(c){var i=new c({id:this.getId()+"-toggleButton"});i.addEventDelegate({ontap:this._onTap,onkeydown:this._onKeydown},this);return i;};return a;});
Version data entries
3 entries across 3 versions & 1 rubygems