Skip to content

Commit

Permalink
Merge pull request #16 from yurkinx/master
Browse files Browse the repository at this point in the history
Fixes duplicating rendered js code multiple times
  • Loading branch information
chiliec committed Nov 28, 2015
2 parents d7d6d1c + 29fd04b commit c8f4c2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class Display extends Widget
* @var string
*/
public $js_after_vote;

/**
* @var string
*/
public $js_code_key='vote';
/**
* @var string
*/
Expand Down Expand Up @@ -121,7 +124,7 @@ function vote(model, target, act){
error: function(jqXHR, textStatus, errorThrown) { $this->js_error_vote }
});
}";
$this->view->registerJs($js, View::POS_END);
$this->view->registerJs($js, View::POS_END, $this->js_code_key);
}

public function run()
Expand Down

0 comments on commit c8f4c2b

Please sign in to comment.