define(["require", "exports", "../ribbon-base/ribbon-constants", "@syncfusion/ej2-ribbon", "../../helper/line-spacing-helper"], function (require, exports, ribbon_constants_1, ej2_ribbon_1, line_spacing_helper_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LINE_SPACING_ID = '_line_spacing';
var LineSpacingGroup = (function () {
function LineSpacingGroup(container) {
this.appliedLineSpacing = '1';
this.container = container;
this.ribbonId = this.container.element.id + ribbon_constants_1.RIBBON_ID;
this.localObj = this.container.localObj;
}
Object.defineProperty(LineSpacingGroup.prototype, "documentEditor", {
get: function () {
return this.container.documentEditor;
},
enumerable: true,
configurable: true
});
LineSpacingGroup.prototype.getLineSpacingItem = function () {
var _this = this;
var id = this.ribbonId;
return {
type: 'DropDown',
keyTip: 'K',
allowedSizes: ej2_ribbon_1.RibbonItemSize.Small,
dropDownSettings: {
iconCss: 'e-de-ctnr-linespacing e-icons',
content: this.localObj.getConstant('Line spacing'),
items: line_spacing_helper_1.LineSpacingHelper.getLineSpacingItems(this.localObj),
select: function (args) {
_this.lineSpacingAction(args);
},
beforeItemRender: function (args) {
line_spacing_helper_1.LineSpacingHelper.customizeLineSpacingItem(args, _this.appliedLineSpacing);
}
},
id: id + exports.LINE_SPACING_ID,
ribbonTooltipSettings: { content: this.localObj.getConstant('Line spacing') }
};
};
LineSpacingGroup.prototype.setLineSpacing = function () {
this.appliedLineSpacing = line_spacing_helper_1.LineSpacingHelper.getCurrentLineSpacing(this.documentEditor, this.localObj);
};
LineSpacingGroup.prototype.lineSpacingAction = function (args) {
var appliedSpacing = { value: this.appliedLineSpacing };
line_spacing_helper_1.LineSpacingHelper.applyLineSpacing(this.documentEditor, args.item.text, appliedSpacing, this.localObj);
this.appliedLineSpacing = appliedSpacing.value;
};
return LineSpacingGroup;
}());
exports.LineSpacingGroup = LineSpacingGroup;
});
|