Skip to content

Commit

Permalink
Should fix layout of text annotation when clicked on cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Jun 9, 2017
1 parent 2db6626 commit a4ecdb7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ function parseQuery(search) {
lng: lang,
fallbackLng: existing_lang[0],
backend: {
loadPath: 'static/locales/{{lng}}/translation.2d451eb2d7f2.json'
loadPath: 'static/locales/{{lng}}/translation.874ba4894433.json'
}
}, function (err, tr) {
if (err) {
Expand Down Expand Up @@ -12714,6 +12714,8 @@ var Textbox = function () {
}, {
key: 'editStyle',
value: function editStyle() {
var _this4 = this;

var map_xy0 = get_map_xy0();
var self = this;
var text_elem = self.textAnnot;
Expand All @@ -12737,7 +12739,7 @@ var Textbox = function () {
current_options.font_weight = current_options.font_weight === '400' || current_options.font_weight === '' ? '' : 'bold';
make_confirm_dialog2('styleTextAnnotation', i18next.t('app_page.text_box_edit_box.title'), { widthFitContent: true }).then(function (confirmed) {
if (!confirmed) {
text_elem.text(current_options.content).styles({
text_elem.styles({
color: current_options.color,
'font-size': current_options.size + 'px',
'font-weight': current_options.font_weight,
Expand All @@ -12749,6 +12751,7 @@ var Textbox = function () {
self.fontFamily = current_options.font_family;
text_elem.attr('transform', current_options.transform_rotate);
self.buffer = current_options.buffer;
_this4.update_text(current_options.content);
} else if (!buffer_txt_chk.node().checked) {
self.buffer = undefined;
}
Expand Down Expand Up @@ -12935,7 +12938,7 @@ var Textbox = function () {

var scaleBar = {
create: function create(x, y) {
var _this4 = this;
var _this5 = this;

if (!proj.invert) {
swal({ title: '',
Expand Down Expand Up @@ -12967,13 +12970,13 @@ var scaleBar = {

var getItems = function getItems() {
return [{ name: i18next.t('app_page.common.edit_style'), action: function action() {
_this4.editStyle();
_this5.editStyle();
} }, { name: i18next.t('app_page.common.up_element'), action: function action() {
_this4.up_element();
_this5.up_element();
} }, { name: i18next.t('app_page.common.down_element'), action: function action() {
_this4.down_element();
_this5.down_element();
} }, { name: i18next.t('app_page.common.delete'), action: function action() {
_this4.remove();
_this5.remove();
} }];
};

Expand Down Expand Up @@ -13157,7 +13160,7 @@ var scaleBar = {

var northArrow = {
display: function display(x, y) {
var _this5 = this;
var _this6 = this;

var x_pos = x || w - 100,
y_pos = y || h - 100,
Expand Down Expand Up @@ -13249,13 +13252,13 @@ var northArrow = {

var getItems = function getItems() {
return [{ name: i18next.t('app_page.common.options'), action: function action() {
_this5.editStyle();
_this6.editStyle();
} }, { name: i18next.t('app_page.common.up_element'), action: function action() {
_this5.up_element();
_this6.up_element();
} }, { name: i18next.t('app_page.common.down_element'), action: function action() {
_this5.down_element();
_this6.down_element();
} }, { name: i18next.t('app_page.common.delete'), action: function action() {
_this5.remove();
_this6.remove();
} }];
};

Expand Down Expand Up @@ -13460,18 +13463,18 @@ var UserRectangle = function () {
}, {
key: 'draw',
value: function draw() {
var _this6 = this;
var _this7 = this;

var context_menu = new ContextMenu();
var getItems = function getItems() {
return [{ name: i18next.t('app_page.common.edit_style'), action: function action() {
_this6.editStyle();
_this7.editStyle();
} }, { name: i18next.t('app_page.common.up_element'), action: function action() {
_this6.up_element();
_this7.up_element();
} }, { name: i18next.t('app_page.common.down_element'), action: function action() {
_this6.down_element();
_this7.down_element();
} }, { name: i18next.t('app_page.common.delete'), action: function action() {
_this6.remove();
_this7.remove();
} }];
};

Expand All @@ -13496,7 +13499,7 @@ var UserRectangle = function () {
}).on('dblclick', function () {
d3.event.preventDefault();
d3.event.stopPropagation();
_this6.handle_ctrl_pt();
_this7.handle_ctrl_pt();
}).call(this.drag_behavior);
// pos_lgds_elem.set(this.rectangle.attr('id'), r.node().getBoundingClientRect());
}
Expand Down Expand Up @@ -13687,18 +13690,18 @@ var UserEllipse = function () {
_createClass(UserEllipse, [{
key: 'draw',
value: function draw() {
var _this7 = this;
var _this8 = this;

var context_menu = new ContextMenu(),
getItems = function getItems() {
return [{ name: i18next.t('app_page.common.edit_style'), action: function action() {
_this7.editStyle();
_this8.editStyle();
} }, { name: i18next.t('app_page.common.up_element'), action: function action() {
_this7.up_element();
_this8.up_element();
} }, { name: i18next.t('app_page.common.down_element'), action: function action() {
_this7.down_element();
_this8.down_element();
} }, { name: i18next.t('app_page.common.delete'), action: function action() {
_this7.remove();
_this8.remove();
} }];
};

Expand All @@ -13721,7 +13724,7 @@ var UserEllipse = function () {
}).on('dblclick', function () {
d3.event.preventDefault();
d3.event.stopPropagation();
_this7.handle_ctrl_pt();
_this8.handle_ctrl_pt();
}).call(this.drag_behavior);
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion magrit_app/static/js/layout_features.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ class Textbox {
.then((confirmed) => {
if (!confirmed) {
text_elem
.text(current_options.content)
.styles({
color: current_options.color,
'font-size': `${current_options.size}px`,
Expand All @@ -558,6 +557,7 @@ class Textbox {
self.fontFamily = current_options.font_family;
text_elem.attr('transform', current_options.transform_rotate);
self.buffer = current_options.buffer;
this.update_text(current_options.content);
} else if (!buffer_txt_chk.node().checked) {
self.buffer = undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions magrit_app/templates/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title> {{ app_name }} </title>
<link rel="icon" type="image/png" href="static/img/favicon.png" />
<link href="static/css/scoped-bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="static/css/style.2d451eb2d7f2.min.css" rel="stylesheet" type="text/css">
<link href="static/css/style.874ba4894433.min.css" rel="stylesheet" type="text/css">
<link href="static/css/vanilla-dataTables.min.css" rel="stylesheet" type="text/css">
<link href="static/css/alertify.min.css" rel="stylesheet" type="text/css">
<link href="static/css/semantic.min.css" rel="stylesheet" type="text/css">
Expand Down Expand Up @@ -51,6 +51,6 @@
</div>
</noscript>
<script src="static/js/lib/bootstrap-native3.mod.min.js"></script>
<script src="static/js/app.2d451eb2d7f2.js"></script>
<script src="static/js/app.874ba4894433.js"></script>
</body>
</html>

0 comments on commit a4ecdb7

Please sign in to comment.