Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add Button::isClicked() wrapper

  • Loading branch information...
commit 03fd2256b20736b466b3c15342c07505fd2cf9a5 1 parent 0a96d49
Romans Malinovskis romaninsh authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/View/Button.php
11 lib/View/Button.php
View
@@ -69,8 +69,19 @@ function render(){
return parent::render();
}
function onClick(){
+ // Obsolete. Use js('click') directly
+ $this->exception('Use generic form of js("click")->univ() instead of onClick()','Obsolete');
return $this->js('click')->univ();
}
+ function isClicked($confirm=null){
+
+ $cl=$this->js('click')->univ();
+ if($confirm)$cl->confirm($confirm);
+
+ $cl->ajaxec($this->api->getDestinationURL(null,array($this->name=>'clicked')));
+
+ return isset($_GET[$this->name]);
+ }
function setAction($js=null,$page=null){
if(strpos($page,'.')===false && strpos($page,':')===false && $page){
$page=$this->api->getDestinationURL($page);
Please sign in to comment.
Something went wrong with that request. Please try again.