Skip to content

Instantly share code, notes, and snippets.

@duellsy
Forked from clouddueling/helpers.php
Last active December 17, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duellsy/5617770 to your computer and use it in GitHub Desktop.
Save duellsy/5617770 to your computer and use it in GitHub Desktop.
$('.unlock-btn').live('click', function(){
$(this).closest('.btn-group').find('.btn-danger').toggleClass('disabled');
$(this).find('i').toggleClass('icon-lock').toggleClass('icon-unlock');
});
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>
";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment