1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00
ifhub.club/application/frontend/components/blog/js/blog-add.js
2015-03-27 17:28:51 +07:00

50 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Форма добавления блога
*
* @module ls/blog/add
*
* @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.lsBlogAdd", $.livestreet.lsComponent, {
/**
* Дефолтные опции
*/
options: {
// Селекторы
selectors: {
type: '.js-blog-add-type',
type_note: '.js-blog-add-field-type .js-field-note'
}
},
/**
* Конструктор
*
* @constructor
* @private
*/
_create: function () {
var _this = this;
this._super();
// Подгрузка информации о выбранном типе блога при создании блога
this.elements.type.on( 'change' + this.eventNamespace, function () {
_this.setTypeNote( $( this ).val() );
});
},
/**
*
*/
setTypeNote: function( type ) {
this.elements.type_note.text( ls.lang.get( 'blog.add.fields.type.note_' + type ) );
}
});
})(jQuery);