Changeset 1448
- Timestamp:
- 2010-03-12 10:56:35 (3 years ago)
- Location:
- trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms
- Files:
-
- 2 edited
-
basic-controls.js (modified) (9 diffs)
-
date.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/basic-controls.js
r1447 r1448 47 47 InputControl.prototype.initElements = function() { 48 48 49 var $input = this.getElement( "input");49 var $input = this.getElement(kf.ControlElements.REV_INPUT); 50 50 51 51 var selector = "input"; 52 52 if(! $input){ 53 // does not contain an input element TODO check if this is OK54 this.setElement( "input", $(this.getTemplate('control')));53 // where to add? 54 this.setElement(kf.ControlElements.REV_INPUT, $(this.getTemplate(kf.ControlElements.REV_CONTROL))); 55 55 $input = this.getElement(); 56 56 } 57 57 if(! $input.is(selector)){ 58 var $element = $(this.getTemplate( 'control'));58 var $element = $(this.getTemplate(kf.ControlElements.REV_CONTROL)); 59 59 $element.attr('kauri-idref', $input.attr('kauri-idref')); 60 60 $input.before($element).remove(); 61 61 kf.ControlElements.index($element, this.getForm(), true); 62 this.setElement("input", $input); 63 // hier herindexeren 62 this.setElement(kf.ControlElements.REV_INPUT, $input); 64 63 } 65 64 … … 125 124 $.extend(OutputControl.prototype.templates, kf.Control.prototype.templates); 126 125 $.extend(OutputControl.prototype.templates, { 127 input : "<span/>"126 control : "<span kauri-role='input'/>" 128 127 }); 129 128 … … 138 137 if(! $output){ 139 138 // does not contain an input element TODO check if this is OK 140 this.setElement( "input", $(this.getTemplate('input')));139 this.setElement(kf.ControlElements.REV_CONTROL, $(this.getTemplate(kf.ControlElements.REV_CONTROL))); 141 140 $output = this.getElement(); 142 141 } 143 142 if(! $output.is(selector)){ 144 $output.html(this.getTemplate( 'input'));143 $output.html(this.getTemplate(kf.ControlElements.REV_CONTROL)); 145 144 } 146 145 … … 189 188 $.extend(CheckBoxControl.prototype.templates, kf.Control.prototype.templates); 190 189 $.extend(CheckBoxControl.prototype.templates, { 191 input: "<input type='checkbox'>"190 control : "<input type='checkbox'>" 192 191 }); 193 192 … … 201 200 if(! $input){ 202 201 // does not contain an input element TODO check if this is OK 203 this.setElement( "input", $(this.getTemplate('input')));202 this.setElement(kf.ControlElements.REV_CONTROL, $(this.getTemplate(kf.ControlElements.REV_CONTROL))); 204 203 $input = this.getElement(); 205 204 } 206 205 if(! $input.is(selector)) 207 $input.html(this.getTemplate( 'input'));206 $input.html(this.getTemplate(kf.ControlElements.REV_CONTROL)); 208 207 209 208 this._input = $input; … … 254 253 $.extend(SelectionControl.prototype.templates, kf.Control.prototype.templates); 255 254 $.extend(SelectionControl.prototype.templates, { 256 input: "<select kauri-role='input'>",255 control : "<select kauri-role='input'>", 257 256 refresh: "<button class='refresh' kauri-role='refresh'>" 258 257 }); … … 274 273 if(! $select){ 275 274 // does not contain an input element TODO check if this is OK 276 $select = $(this.getTemplate( 'input'))277 this.setElement( "input", $select);275 $select = $(this.getTemplate(kf.ControlElements.REV_CONTROL)) 276 this.setElement(kf.ControlElements.REV_INPUT, $select); 278 277 } 279 278 if(! $select.is(selector)){ 280 $select.html(this.getTemplate( 'input'));279 $select.html(this.getTemplate(kf.ControlElements.REV_CONTROL)); 281 280 $select = $(selector,$select); 282 this.setElement( "input", $select);281 this.setElement(kf.ControlElements.REV_INPUT, $select); 283 282 } 284 283 // TODO read the options from the HTML - set them on the ready options object … … 439 438 $.extend(TextareaControl.prototype.templates, kf.Control.prototype.templates); 440 439 $.extend(TextareaControl.prototype.templates, { 441 input: "<textarea/>"440 control: "<textarea/>" 442 441 }); 443 442 … … 449 448 if(! $textarea){ 450 449 // does not contain an input element TODO check if this is OK 451 this.setElement( "input", $(this.getTemplate('input')));450 this.setElement(kf.ControlElements.REV_INPUT), $(this.getTemplate(kf.ControlElements.REV_CONTROL)); 452 451 $textarea = this.getElement(); 453 452 } 454 453 if(! $textarea.is(selector)) 455 $textarea.html(this.getTemplate( 'input'));454 $textarea.html(this.getTemplate(kf.ControlElements.REV_CONTROL)); 456 455 457 456 // defaults -
trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/date.js
r1443 r1448 320 320 $.extend(DateControl.prototype.templates, kf.Control.prototype.templates); 321 321 $.extend(DateControl.prototype.templates, { 322 input:"<div><input type='text' kauri-role='input'/></div>"322 control :"<div><input type='text' kauri-role='input'/></div>" 323 323 }); 324 324 DateControl.prototype.initElements = function ( ) { … … 328 328 if(! $input){ 329 329 // does not contain an input element TODO check if this is OK 330 $input = $(this.getTemplate( 'input'))331 this.setElement( "input", $input);330 $input = $(this.getTemplate(kf.ControlElements.REV_CONTROL)); 331 this.setElement(kf.ControlElements.REV_INPUT, $input); 332 332 } 333 333 if(! $input.is(selector)){ 334 $input.html(this.getTemplate( 'input'));334 $input.html(this.getTemplate(kf.ControlElements.REV_CONTROL)); 335 335 $input = $("div > input",$input); 336 336 }
Note: See TracChangeset
for help on using the changeset viewer.