Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed checkbox handling in ie 7 and 8

  • Loading branch information...
commit eaa9c529a8f5315cfafeabfba736998270200c6d 1 parent 50b69dc
Maik Vlcek authored
55 INSTALL
View
@@ -1,55 +0,0 @@
-INSTALLATION NOTES for Custom Form Elements
-****************************************************
-
-Once you copied all the files to your project's directory, you are able to use the power of CFE right away
-(Just unpack the supplied cfe package in your website root).
-
-
-°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
-Just include the CSS and Javascript files
-- add css in <head>-section
-- add javascript files right before the (closing) </body>-tag
-°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
-
-<!-- add css -->
-<link rel="stylesheet" type="text/css" href="css/cfe.css" />
-
-JS Variant [A]
-<script type="text/javascript" src="js/cfe/cfe-min.js"></script>
-
-JS Variant [B]
-<!-- add cfe base -->
-<script type="text/javascript" src="js/cfe/base/cfe.base.js"></script>
-<!-- add cfe replacement script -->
-<script type="text/javascript" src="js/cfe/base/cfe.replace.js"></script>
-
-<!-- add modules -->
-<script type="text/javascript" src="js/cfe/modules/cfe.module.checkbox.js"></script>
-<script type="text/javascript" src="js/cfe/modules/cfe.module.radio.js"></script>
-<script type="text/javascript" src="js/cfe/modules/cfe.module.text.js"></script>
-<script type="text/javascript" src="js/cfe/modules/cfe.module.select.js"></script>
-[...and so on - just include the modules you want to use]
-
- <!-- add addons -->
-<script type="text/javascript" src="js/cfe/addons/cfe.addon.toolTips.js"></script>
- <script type="text/javascript" src="js/cfe/addons/cfe.addon.dependencies.js"></script>
-
-
-window.addEvent('domready', function(){
- // path to a 1x1 pixel transparent gif
- cfe.spacer = "gfx/spacer.gif";
-
- // create a cfe replacement instance
- var myCfe = new cfe.replace();
-
- // now you may set options [see cfe.autostart.sample for details]
-
- // initialize cfe
- myCfe.init();
-});
-
-°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
-Advanced user? More options? More configuration?
-°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
-View Demopage for sample integration with fancy effects and more configuration => http://customformelements.net/demo.php
-For a complete API documentation and developer docs, check => http://customformelements.net/api-docs.php.
7 cfe/modules/button/cfe.module.button.js
View
@@ -480,7 +480,7 @@ cfe.module.Button = new Class(
this.a.addClass("P");
this.fireEvent("onPress");
- console.log(this.type + "pressed");
+ //console.log(this.type + "pressed");
},
/**
@@ -497,7 +497,7 @@ cfe.module.Button = new Class(
this.a.removeClass("P");
this.fireEvent("onRelease");
- console.log(this.type + "released");
+ //console.log(this.type + "released");
},
@@ -580,6 +580,9 @@ cfe.module.Button = new Class(
*/
clicked: function(e)
{
+ //causes problems in other browsers than ie - gonna took into this later; its the best approach to stop the event from bubbling right here though imho
+ //e.stop();
+
if(this.isDisabled()) return
if( $chk(this.o.click) && $chk(this.options.delegateClick) ) this.o.click();
42 cfe/modules/check/cfe.module.checkbox.js
View
@@ -11,21 +11,9 @@
* <li>Firefox 3.6.</li>
* <li>Google Chrome 6.</li>
* <li>Opera 10.62.</li>
- *
- * <li>IE 7
- * <ul>
- * <li>default checked element wont be triggered by label</li>
- * <li>implicit labels - no trigger</li>
- * </ul>
- * </li>
- *
- * <li>IE 8
- * <ul>
- * <li>labels dont work for normal labelled elements</li>
- * </ul>
- * </li>
- *
- * </ul>
+ * <li>IE 7.</li>
+ * <li>IE 8.</li>
+ * </ul>
*
* @class Checkbox
* @namespace cfe.module
@@ -69,10 +57,21 @@ cfe.module.Checkbox = new Class({
// important for resetting dynamically created cfe
this.o.defaultChecked = this.o.checked;
- // update fix for internet explorer and opera
- if( Browser.Engine.presto || Browser.Engine.trident)
+ if( Browser.Engine.presto || Browser.Engine.trident )
{
- this.o.addEvent( "click", this.update.bind(this) );
+ //console.log("fix for element update (IE and Opera)")
+ this.o.addEvent("click", this.update.bind(this) );
+ }
+
+
+ if(Browser.Engine.trident && this.o.implicitLabel)
+ {
+ //console.log("fix for implicit labels (IE) element["+this.o.id+"]")
+ this.l.removeEvents("click")
+ this.a.removeEvents("click").addEvent("click", function(e){
+ e.stop();
+ this.clicked.bind(this)();
+ }.bind(this))
}
this.update();
@@ -93,6 +92,13 @@ cfe.module.Checkbox = new Class({
});
},
+ clicked: function(e)
+ {
+ if(Browser.Engine.trident && e) e.stop();
+
+ this.parent()
+ },
+
/**
* public method to check a checkbox programatically
*
4 cfe/modules/select/cfe.module.select.js
View
@@ -1,7 +1,3 @@
-/**
- * @module Helper
- */
-
cfe.helper = cfe.helper || {}
/**
4 cfe/replace/cfe.replace.js
View
@@ -129,7 +129,9 @@ cfe.Replace = new Class(
var selector = module.prototype.selector;
this.options.scope.getElements(selector).each(function(el,i){
-
+
+ if(el.retrieve("cfe") != null) return
+
var basicOptions = {
replaces: el
};
Please sign in to comment.
Something went wrong with that request. Please try again.