1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 17:34:26 +03:00
ifhub.club/application/frontend/components/topic/js/topic-favourite.js

34 lines
854 B
JavaScript

/**
* Кнопка добавления топика в избранное
*
* @module ls/topic/favourite
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
(function($) {
"use strict";
$.widget( "livestreet.lsTopicFavourite", $.livestreet.lsFavourite, {
/**
* Дефолтные опции
*/
options: {
urls: {
toggle: aRouter['ajax'] + 'favourite/topic/'
},
tags: null
},
/**
*
*/
onToggleSuccess: function ( response ) {
this._super( response );
this.option( 'tags' ).lsTagsFavourite( 'setEditable', response.bState );
}
});
})(jQuery);