From 2eb56cb473a2725fce3def7906ddbf7c1de49ccb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 18 May 2021 01:58:40 +0300 Subject: [PATCH] [DE embed] Align title to the center --- .../embed/js/ApplicationController.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 36afc29d5..1b1e81d2b 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -39,7 +39,8 @@ DE.ApplicationController = new(function(){ permissions = {}, maxPages = 0, created = false, - ttOffset = [0, -10]; + ttOffset = [0, -10], + labelDocName; // Initialize analytics // ------------------------- @@ -121,7 +122,8 @@ DE.ApplicationController = new(function(){ } embedConfig.docTitle = docConfig.title; - $('#title-doc-name').text(embedConfig.docTitle || ''); + labelDocName = $('#title-doc-name'); + labelDocName.text(embedConfig.docTitle || '') } } @@ -393,6 +395,15 @@ DE.ApplicationController = new(function(){ api.asc_setAutoSaveGap(1); } + var $parent = labelDocName.parent(); + var _left_width = $parent.position().left, + _right_width = $parent.next().outerWidth(); + + if ( _left_width < _right_width ) + $parent.css('padding-left', _right_width - _left_width); + else + $parent.css('padding-right', _left_width - _right_width); + api.asc_LoadDocument(); api.Resize(); }