mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-10 23:36:04 +01:00
Improved the UI for the Parent Page Route dropdown when adding a new Page / Folder
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
# v1.9.0-rc.5
|
||||||
|
## MM/DD/2019
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Improved the UI for the Parent Page Route dropdown when adding a new Page / Folder
|
||||||
|
|
||||||
# v1.9.0-rc.4
|
# v1.9.0-rc.4
|
||||||
## 03/20/2019
|
## 03/20/2019
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,22 @@ import 'selectize';
|
|||||||
import '../../utils/selectize-required-fix';
|
import '../../utils/selectize-required-fix';
|
||||||
import '../../utils/selectize-option-click';
|
import '../../utils/selectize-option-click';
|
||||||
|
|
||||||
|
const PagesRoute = {
|
||||||
|
option: function(item, escape) {
|
||||||
|
const label = escape(item.text).split(' ');
|
||||||
|
const arrows = label.shift();
|
||||||
|
const slug = label.shift();
|
||||||
|
|
||||||
|
return `<div class="selectize-route-option">
|
||||||
|
<span class="text-grey">${arrows}</span>
|
||||||
|
<span>
|
||||||
|
<span class="text-update">${slug.replace('(', '/').replace(')', '')}</span>
|
||||||
|
<span>${label.join(' ')}</span>
|
||||||
|
</span>
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export default class SelectizeField {
|
export default class SelectizeField {
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
this.options = Object.assign({}, options);
|
this.options = Object.assign({}, options);
|
||||||
@@ -20,6 +36,10 @@ export default class SelectizeField {
|
|||||||
let data = (isInput ? element.closest('[data-grav-selectize]') : element).data('grav-selectize') || {};
|
let data = (isInput ? element.closest('[data-grav-selectize]') : element).data('grav-selectize') || {};
|
||||||
let field = (isInput ? element : element.find('input, select'));
|
let field = (isInput ? element : element.find('input, select'));
|
||||||
|
|
||||||
|
if (field.attr('name') === 'data[route]') {
|
||||||
|
data = $.extend({}, data, { render: PagesRoute });
|
||||||
|
}
|
||||||
|
|
||||||
if (!field.length || field.get(0).selectize) { return; }
|
if (!field.length || field.get(0).selectize) { return; }
|
||||||
const plugins = $.merge(data.plugins ? data.plugins : [], ['required-fix']);
|
const plugins = $.merge(data.plugins ? data.plugins : [], ['required-fix']);
|
||||||
field.selectize($.extend({}, data, { plugins }));
|
field.selectize($.extend({}, data, { plugins }));
|
||||||
|
|||||||
4
themes/grav/css-compiled/preset.css
vendored
4
themes/grav/css-compiled/preset.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/grav/css-compiled/template.css
vendored
2
themes/grav/css-compiled/template.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/grav/css/selectize.min.css
vendored
2
themes/grav/css/selectize.min.css
vendored
File diff suppressed because one or more lines are too long
4
themes/grav/js/admin.min.js
vendored
4
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -136,6 +136,14 @@ a {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-gray, .text-grey {
|
||||||
|
color: $nav-text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-update {
|
||||||
|
color: $update-bg;
|
||||||
|
}
|
||||||
|
|
||||||
// Typography
|
// Typography
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 10px solid darken($content-bg, 10%);
|
border-left: 10px solid darken($content-bg, 10%);
|
||||||
|
|||||||
@@ -324,6 +324,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selectize-route-option {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
> :first-child {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
width: auto;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
> :last-child {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none!important;
|
display: none!important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user