Commits

Christoffer Niska  committed 506fe58

Add support for actually disabling buttons (fixes #157)

  • Participants
  • Parent commits 01cc754

Comments (0)

Files changed (1)

File widgets/TbButton.php

 			$classes[] = 'active';
 
 		if ($this->disabled)
+		{
+			$disableTypes = array(self::BUTTON_BUTTON, self::BUTTON_SUBMIT, self::BUTTON_RESET,
+				self::BUTTON_AJAXBUTTON, self::BUTTON_AJAXSUBMIT, self::BUTTON_INPUTBUTTON, self::BUTTON_INPUTSUBMIT);
+
+			if (in_array($this->buttonType, $disableTypes))
+				$this->htmlOptions['disabled'] = 'disabled';
+
 			$classes[] = 'disabled';
+		}
 
         if (!isset($this->url) && isset($this->htmlOptions['href']))
         {