1 /* 2 * ***** BEGIN LICENSE BLOCK ***** 3 * Zimbra Collaboration Suite Web Client 4 * Copyright (C) 2011, 2013, 2014, 2015, 2016 Synacor, Inc. 5 * 6 * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: https://www.zimbra.com/license 9 * The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 10 * have been added to cover use of software over a computer network and provide for limited attribution 11 * for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B. 12 * 13 * Software distributed under the License is distributed on an "AS IS" basis, 14 * WITHOUT WARRANTY OF ANY KIND, either express or implied. 15 * See the License for the specific language governing rights and limitations under the License. 16 * The Original Code is Zimbra Open Source Web Client. 17 * The Initial Developer of the Original Code is Zimbra, Inc. All rights to the Original Code were 18 * transferred by Zimbra, Inc. to Synacor, Inc. on September 14, 2015. 19 * 20 * All portions of the code are Copyright (C) 2011, 2013, 2014, 2015, 2016 Synacor, Inc. All Rights Reserved. 21 * ***** END LICENSE BLOCK ***** 22 */ 23 /** 24 * @overview 25 * A link that is a button. Currently used only for the "help" link/button 26 * 27 * @author Eran Yarkon 28 * 29 * @extends DwtButton 30 31 */ 32 DwtLinkButton = function(params) { 33 params.className = params.className || "ZButtonLink"; 34 this._noDropDown = params.noDropDown; 35 this._elementTag = params.elementTag; 36 DwtButton.call(this, params); 37 }; 38 39 40 DwtLinkButton.prototype = new DwtButton; 41 DwtLinkButton.prototype.constructor = DwtLinkButton; 42 DwtLinkButton.prototype.role = 'link'; 43 44 DwtLinkButton.prototype.TEMPLATE = "dwt.Widgets#ZLinkButton"; 45 46 // defaults for drop down images (set here once on prototype rather than on each button instance) 47 DwtLinkButton.prototype._dropDownImg = null; //no longer using HelpPullDownArrow - we do the arrow via pixel-high divs 48 DwtLinkButton.prototype._dropDownDepImg = null; //same as above 49 DwtLinkButton.prototype._dropDownHovImg = null; //same as above 50 51 DwtLinkButton.prototype.toString = 52 function() { 53 return "DwtLinkButton"; 54 }; 55 56 DwtLinkButton.prototype._createHtmlFromTemplate = function(templateId, data) { 57 data = data || {}; 58 data.noDropDown = this._noDropDown; 59 DwtButton.prototype._createHtmlFromTemplate.call(this, templateId, data); 60 }; 61 62 DwtLinkButton.prototype._createElement = 63 function() { 64 return document.createElement(this._elementTag || "SPAN"); 65 }; 66