Skip to content

Commit

Permalink
add bootstrap ignore, only apply bootstrap to frontend forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Uncle Cheese committed Dec 22, 2014
2 parents 523237f + 5706d26 commit e7807ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/BootstrapFieldList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

class BootstrapFieldList extends Extension {


protected $ignores = array ();


public function bootstrapify() {
foreach($this->owner as $f) {


if(isset($this->ignores[$f->getName()])) continue;

// If we have a Tabset, bootstrapify all Tabs
Expand Down Expand Up @@ -50,6 +52,7 @@ public function bootstrapify() {
}



public function bootstrapIgnore($field) {
$this->ignores[$field] = true;

Expand Down
2 changes: 2 additions & 0 deletions code/BootstrapForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public function forTemplate() {
Requirements::javascript(BOOTSTRAP_FORMS_DIR."/javascript/bootstrap_forms.js");
}
$this->addExtraClass("form-{$this->formLayout}");

$this->applyBootstrap();

return parent::forTemplate();
}

Expand Down

0 comments on commit e7807ff

Please sign in to comment.