Skip to content

Commit

Permalink
only require entwine and zenvalidator.js if not using custom js
Browse files Browse the repository at this point in the history
  • Loading branch information
sheadawson committed Aug 10, 2015
1 parent b2d39f7 commit 5734d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/ZenValidator.php
Expand Up @@ -80,9 +80,7 @@ public function setForm($form) {
public function applyParsley(){
$this->parsleyEnabled = true;
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR.'/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(ZENVALIDATOR_PATH . '/javascript/parsley/parsley.remote.min.js');
Requirements::javascript(ZENVALIDATOR_PATH.'/javascript/zenvalidator.js');

$lang = i18n::get_lang_from_locale(i18n::get_locale());
if($lang != 'en') {
Expand All @@ -92,6 +90,8 @@ public function applyParsley(){
if($this->form){
if ($this->defaultJS) {
$this->form->addExtraClass('parsley');
Requirements::javascript(THIRDPARTY_DIR.'/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(ZENVALIDATOR_PATH.'/javascript/zenvalidator.js');
}else{
$this->form->addExtraClass('custom-parsley');
}
Expand Down

0 comments on commit 5734d8d

Please sign in to comment.