-
18 Sep 2012 6:31 AM #1
Button.setIconCls - doesn't check if icon class changed
Button.setIconCls - doesn't check if icon class changed
The Button.setIconCls method does not check if the class actually changed before resetting the value.
Is this intentional?
Code:Ext.define('Ext.button.Button', { ... setIconCls: function(cls) { var me = this, btnIconEl = me.btnIconEl, oldCls = me.iconCls; me.iconCls = cls; if (btnIconEl) { // Remove the previous iconCls from the button btnIconEl.removeCls(oldCls); btnIconEl.addCls(cls || ''); me.setComponentCls(); if (me.didIconStateChange(oldCls, cls)) { me.updateLayout(); } } return me; }, ....
-
24 Sep 2012 12:19 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
I think it can do a simple if statement to check to stop it if it doesn't need to. We will discuss this internally, opening a bug for it.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
26 Sep 2012 12:16 AM #3
The didStateChange checks: Did we go from having no icon to having an icon or vice versa.
But yes, we could probably add in a check there, not really a bug though.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7342
in
4.1.4.


Reply With Quote