Created
May 21, 2013 03:29
-
-
Save clouddueling/5617310 to your computer and use it in GitHub Desktop.
laravel unlock delete button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML::macro('unlock_delete', function($url, $message = 'Confirm delete?', $class = "") | |
{ | |
return " | |
<div class='btn-group'> | |
<span class='btn {$class} btn-danger disabled' data-url=\"" . url($url) . "\" data-message=\"{$message}\"> | |
<i class='icon-remove'></i> | |
</span> | |
<span class='btn {$class} unlock-btn'> | |
<i class='icon-lock'></i> Unlock | |
</span> | |
</div> | |
"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.unlock-btn').live('click', function(){ | |
$(this).closest('.btn-group').find('.btn-danger').toggleClass('disabled'); | |
$(this).find('i').toggleClass('icon-lock').toggleClass('icon-unlock'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where should I put it tho?