Skip to content

Commit b67f110

Browse files
committed
Merge remote-tracking branch 'origin/development' into development
2 parents d1f33c2 + f2c0fa3 commit b67f110

File tree

5 files changed

+88
-82
lines changed

5 files changed

+88
-82
lines changed

src/Template/Element/tags/editor.ctp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ if (! isset($selectedTags)) {
1212
if (!isset($hideLabel)) {
1313
$hideLabel = false;
1414
}
15-
echo $this->Html->script('tag_manager.js');
15+
echo $this->Html->script('/data_center/js/tag_manager.js');
16+
echo $this->Html->css('/data_center/css/tag_editor.css');
1617
?>
1718

1819
<div class="input" id="tag_editing">
@@ -100,7 +101,7 @@ echo $this->Html->script('tag_manager.js');
100101

101102
<?php
102103
if (! isset($options)) {
103-
$options = array();
104+
$options = [];
104105
}
105106
echo $this->Tag->setup($availableTags, $selectedTags, $options);
106107
if ($allow_custom) {

src/View/Helper/TagHelper.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,12 @@ private function formatSelectedTags($selected_tags)
5959
}
6060
public function setup($available_tags, $selected_tags = [], $options = [])
6161
{
62-
$this->Html->script('/data_center/js/tag_manager.js', ['inline' => false]);
63-
$this->Html->css('/data_center/css/tag_editor.css', ['inline' => false]);
6462
$params = array(
65-
'tags: '.$this->Js->object($this->availableTagsForJs($available_tags))
63+
'tags: '.json_encode($this->availableTagsForJs($available_tags))
6664
);
6765
if (! empty($selected_tags)) {
6866
$selected_tags = $this->formatSelectedTags($selected_tags);
69-
$params[] = 'selected_tags: '.$this->Js->object($this->selectedTagsForJs($selected_tags));
67+
$params[] = 'selected_tags: '.json_encode($this->selectedTagsForJs($selected_tags));
7068
}
7169
if (! empty($options)) {
7270
foreach ($options as $var => $val) {
@@ -78,6 +76,10 @@ public function setup($available_tags, $selected_tags = [], $options = [])
7876
$params[] = "$var: $val";
7977
}
8078
}
81-
$this->Js->buffer('TagManager.init({'.implode(', ', $params).'});');
79+
echo '
80+
<script>
81+
TagManager.init({'.implode(', ', $params).'});
82+
</script>
83+
';
8284
}
8385
}

webroot/css/tag_editor.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webroot/css/tag_editor.less

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
1+
// out: tag_editor.css, compress: true
2+
13
#tag_editing {
2-
font-size: 90%;
3-
line-height: 16px;
4-
margin-bottom: 20px;
5-
overflow: visible;
4+
font-size: 90%;
5+
line-height: 16px;
6+
margin-bottom: 20px;
7+
overflow: visible;
68
width: 100%;
7-
9+
810
.label {
911
font-weight: bold;
1012
}
1113
img.expand_collapse {
12-
height: 10px;
14+
height: 10px;
1315
width: 10px;
1416
}
15-
img.expand_collapse,
17+
img.expand_collapse,
1618
img.leaf {
17-
margin-left: -15px;
19+
margin-left: -15px;
1820
padding-right: 8px;
1921
}
2022
}
2123
#available_tags {
2224
border: 1px solid #aaa;
2325
overflow: hidden;
2426
padding: 5px;
25-
27+
2628
ul {
27-
margin: 0;
28-
padding-left: 15px;
29+
margin: 0;
30+
padding-left: 15px;
2931
text-transform: capitalize;
30-
32+
3133
.submenu_handle {
3234
cursor: pointer;
3335
}
3436
}
3537
a {
3638
&.selected {
37-
color: #000;
39+
color: #000;
3840
cursor: text;
39-
41+
4042
&:hover {
41-
color: #000;
43+
color: #000;
4244
text-decoration: none;
4345
}
4446
}
4547
}
4648
> div {
47-
max-height: 300px;
49+
max-height: 300px;
4850
overflow: auto;
4951
position: relative;
5052
}
5153
.ui-widget-content {
5254
a {
5355
color: #0099BB;
54-
56+
5557
&.selected {
5658
color: #000;
5759
}
@@ -75,21 +77,21 @@
7577
}
7678
}
7779
#tag_help_toggler {
78-
float: right;
80+
float: right;
7981
margin-left: 5px;
8082
}
8183
.ui-autocomplete {
8284
font-size: 80%;
83-
85+
8486
li {
8587
list-style-type: none;
8688
}
8789
}
8890
.ui-effects-transfer {
89-
background-color: rgba(0, 0, 0, 0.2);
91+
background-color: rgba(0, 0, 0, 0.2);
9092
border: 1px dotted #555;
9193
z-index: 10;
9294
}
9395
#custom_tag_input_wrapper {
9496
margin-top: 15px;
95-
}
97+
}

0 commit comments

Comments
 (0)