Skip to content
Browse files

add Button::isClicked() wrapper

  • Loading branch information...
1 parent 0a96d49 commit 03fd2256b20736b466b3c15342c07505fd2cf9a5 @romaninsh romaninsh committed May 2, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/View/Button.php
View
11 lib/View/Button.php
@@ -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);

0 comments on commit 03fd225

Please sign in to comment.
Something went wrong with that request. Please try again.