Skip to content

Instantly share code, notes, and snippets.

@progsmile
Created February 14, 2017 19:01
Show Gist options
  • Save progsmile/99b9e059c0cc4b1b3cdd6f12d245ec26 to your computer and use it in GitHub Desktop.
Save progsmile/99b9e059c0cc4b1b3cdd6f12d245ec26 to your computer and use it in GitHub Desktop.
Ajax Links
import toastr from 'toastr'
// this = jQuery element .ajaxLink
export default {
redirectHome(){
location.href = '/';
},
reload() {
location.reload();
},
removeRow(){
this.parentsUntil('tbody').remove();
},
removeParent(){
this.parent().remove();
},
message(response) {
toastr[response.status](response.message);
},
opacited(){
this.toggleClass('opacited');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment