Completed
Last Updated: 14 Oct 2016 12:48 by ADMIN
ADMIN
Danail Vasilev
Created on: 12 Sep 2016 13:56
Category: UI for ASP.NET AJAX
Type: Bug Report
1
PressedCssClass and HoveredCssClass properties of the Icon in PushButton do not take effect
For the time being you can use the following workaround:
<telerik:RadPushButton CssClass="fa bcmbutton" ID="btnAnimate" runat="server" Text="Save & Stay" AutoPostBack="false">
			<Icon PressedCssClass="fa-cog" HoveredCssClass="hovClass" CssClass="rbOk"  />
		</telerik:RadPushButton>

Workaround:

		<script>
			Telerik.Web.UI.Button.IconsUI.prototype.mouseover = function (ev) {
				var that = this,
					iconData = that.options.iconData,
					priIconEl = that.getPrimaryIconElement(),
					secIconEl = that.getSecondaryIconElement(),
					hoveredCssClass = that.options.iconData.primaryHoveredCssClass;

				if (hoveredCssClass) {
					$telerik.$(priIconEl).addClass(hoveredCssClass);
				}

				that._setBackground(priIconEl, iconData.primaryHoveredIconUrl);
				that._setBackground(secIconEl, iconData.secondaryHoveredIconUrl);

				that.base.mouseover(ev);
			},

				Telerik.Web.UI.Button.IconsUI.prototype.mouseout = function (ev) {
					var that = this,
						iconData = that.options.iconData,
						priIconEl = that.getPrimaryIconElement(),
						secIconEl = that.getSecondaryIconElement(),
						hoveredCssClass = that.options.iconData.primaryHoveredCssClass;

					if (hoveredCssClass) {
						$telerik.$(priIconEl).removeClass(hoveredCssClass);
					}

					that._setBackground(priIconEl, iconData.primaryIconUrl);
					that._setBackground(secIconEl, iconData.secondaryIconUrl);

					that.base.mouseout(ev);
				},

				Telerik.Web.UI.Button.IconsUI.prototype.mousedown = function (ev) {
					var that = this,
						iconData = that.options.iconData,
						priIconEl = that.getPrimaryIconElement(),
						secIconEl = that.getSecondaryIconElement(),
						pressedCssClass = that.options.iconData.primaryPressedCssClass;

					if (pressedCssClass) {
						$telerik.$(priIconEl).addClass(pressedCssClass);
					}

					that._setBackground(priIconEl, iconData.primaryPressedIconUrl);
					that._setBackground(secIconEl, iconData.secondaryPressedIconUrl);

					that.base.mousedown(ev);
				},

				Telerik.Web.UI.Button.IconsUI.prototype.mouseup = function (ev) {
					var that = this,
						iconData = that.options.iconData,
						priIconEl = that.getPrimaryIconElement(),
						secIconEl = that.getSecondaryIconElement(),
						isHovered = that.isMouseOverElement(that.element, ev),
						priIconUrl = isHovered && iconData.primaryHoveredIconUrl ? iconData.primaryHoveredIconUrl : iconData.primaryIconUrl,
						secIconUrl = isHovered && iconData.secondaryHoveredIconUrl ? iconData.secondaryHoveredIconUrl : iconData.secondaryIconUrl,
						pressedCssClass = that.options.iconData.primaryPressedCssClass;

					if (pressedCssClass) {
						$telerik.$(priIconEl).removeClass(pressedCssClass);
					}

					that._setBackground(priIconEl, priIconUrl);
					that._setBackground(secIconEl, secIconUrl);

					that.base.mouseup(ev);
				};
		</script>
0 comments