Skip to content

Commit

Permalink
- disabled attribute now fully supported by input type=image and sele…
Browse files Browse the repository at this point in the history
…ct multiple=multiple
  • Loading branch information
mediavrog committed May 13, 2009
1 parent e27743a commit 193fd0b
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 42 deletions.
103 changes: 62 additions & 41 deletions cfe/mootools/1.2/base/cfe.replace.autostart.js
Expand Up @@ -76,7 +76,27 @@ window.addEvent('domready', function()
$("chb4").toggleDisabled();
});

/* standalone elements
$("trigger2").addEvent("click", function(e){
e.stop();
$("sel-norm3").toggleDisabled();
});

$("trigger3").addEvent("click", function(e){
e.stop();
$("sel-mult2").toggleDisabled();
});

$("triggertxt").addEvent("click", function(e){
e.stop();
$("input4").toggleDisabled();
});

$("triggerta").addEvent("click", function(e){
e.stop();
$("textarea2").toggleDisabled();
});

/* standalone elements */
var uli = new Element("ul");
$('standalone').adopt(uli);

Expand Down Expand Up @@ -138,45 +158,46 @@ window.addEvent('domready', function()
li = new Element("li").adopt(file.getFull());
uli.adopt(li);

var sel = new cfe.module.select({
instanceID: 106,
label: "Standalone Select",
name: "selectStandalone",
options: {
opt1: {
label:"Option A"
},
opt2: {
label: "Option B",
selected: true
},
opt3: {
label: "Option C"
}
}
});
li = new Element("li").adopt(sel.getFull());
uli.adopt(li);
var selm = new cfe.module.select_multiple({
instanceID: 107,
label: "Standalone Select Multipl",
name: "selectMultipleStandalone",
options: {
opt1: {
label:"Option A",
selected: true
},
opt2: {
label: "Option B"
},
opt3: {
label: "Option C"
}
}
});
li = new Element("li").adopt(selm.getFull());
uli.adopt(li);
// still a few bugs to fix
// var sel = new cfe.module.select({
// instanceID: 106,
// label: "Standalone Select",
// name: "selectStandalone",
// options: {
// opt1: {
// label:"Option A"
// },
// opt2: {
// label: "Option B",
// selected: true
// },
// opt3: {
// label: "Option C"
// }
// }
// });
// li = new Element("li").adopt(sel.getFull());
// uli.adopt(li);
//
// var selm = new cfe.module.select_multiple({
// instanceID: 107,
// label: "Standalone Select Multipl",
// name: "selectMultipleStandalone",
// options: {
// opt1: {
// label:"Option A",
// selected: true
// },
// opt2: {
// label: "Option B"
// },
// opt3: {
// label: "Option C"
// }
// }
// });
// li = new Element("li").adopt(selm.getFull());
// uli.adopt(li);

var submit = new cfe.module.submit({
instanceID: 108,
Expand All @@ -185,6 +206,6 @@ window.addEvent('domready', function()
});
li = new Element("li").adopt(submit.getFull());
uli.adopt(li);
*/


});
12 changes: 12 additions & 0 deletions cfe/mootools/1.2/modules/cfe.module.image.js
Expand Up @@ -76,5 +76,17 @@ cfe.module.image = new Class({
this.parent();
this.clearState();
if(this.a.hasClass("F")) this.setState("F");
},

enable: function()
{
this.parent();
this.clearState();
},

disable: function()
{
this.parent();
this.setState("D");
}
});
15 changes: 14 additions & 1 deletion cfe/mootools/1.2/modules/cfe.module.select_multiple.js
Expand Up @@ -15,13 +15,26 @@ cfe.module.select_multiple = new Class({
scrolling: true,
scrollSteps: 5
},

build: function()
{
this.a.addClass("jsSelectorMultiple jsSelectorMultiple"+this.options.instanceID);
this.a.removeClass("jsSelector");

this.buildContainer();

this.o.addEvents({
onDisable: function(){
this.aliasOptions.getChildren().each(function(el){
el.getChildren("input")[0].disable();
});
}.bind(this),
onEnable: function(){
this.aliasOptions.getChildren().each(function(el){
el.getChildren("input")[0].enable();
});
}.bind(this)
});
},

buildOption: function(el, index)
Expand Down

0 comments on commit 193fd0b

Please sign in to comment.