Skip to content

Commit

Permalink
43299 settings pages property list loading time (#712)
Browse files Browse the repository at this point in the history
* 43299 settings pages property list loading time

* 43299 update unit test

* 43299 update unit test

* 43299 update css

* 43299 fix unit test

* 43299 delete chosen script

* 43299 refactor code

* 43299 update unit test

* 43299 update CSS icon remove

* 43299 update CSS

* Refactoring
#3999579

---------

Co-authored-by: Frederic Alpers <88546396+fredericalpers@users.noreply.github.com>
Co-authored-by: dai.trinh <dai.trinh@eastgate-software.com>
Co-authored-by: andernath <chibineko@gmail.com>
  • Loading branch information
4 people authored Jun 5, 2024
1 parent 5d8cb9e commit 4cbf33a
Show file tree
Hide file tree
Showing 44 changed files with 257 additions and 13,310 deletions.
38 changes: 20 additions & 18 deletions css/admin.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#onoffice-ajax .metabox-holder .postbox-container .postbox .chosen-container .chosen-drop {
display: grid;
}

#onoffice-ajax .metabox-holder .postbox-container .postbox .template-list input,
#onoffice-ajax .metabox-holder .postbox-container .postbox .template-list label,
#onoffice-ajax .metabox-holder .postbox-container .postbox .template-list select {
Expand Down Expand Up @@ -78,22 +74,20 @@ body #onoffice-ajax span.viewusage .italic {
min-height: 320px;
max-width: 488px;
background: #fff;
width: 50%;
width: 49%;
}

#sortableFieldsList .menu-item-bar {
display: block;
padding-left: 12px;
margin: 0 12px;
}

#sortableFieldsList .menu-item-bar > .menu-item-handle {
max-width: 430px;
width: 100%;
}

#sortableFieldsList .menu-item-settings {
max-width: 440px;
width: 100%;
}

#sortableFieldsList .menu-item-settings .submitdelete {
Expand All @@ -109,7 +103,7 @@ body #onoffice-ajax span.viewusage .italic {
#sortableFieldsList .menu-item-settings {
display: block;
position: relative;
margin-left: 12px;
margin: 0 12px;
background: #fff;
clear: both;
}
Expand Down Expand Up @@ -524,17 +518,25 @@ body #post-head-content p.wp-clearfix:nth-child(1) {
margin-bottom: 5px;
}

.oo-poststuff .custom-input-field .chosen-container-single,
.oo-poststuff .custom-input-field .chosen-container-multi {
width: 50% !important;
.oo-poststuff .custom-input-field .select2 .select2-selection {
display: flex;
border: 1px solid #8c8f94;
min-height: 30px;
height: 100%;
}

.oo-poststuff .custom-input-field .select2 .select2-selection .select2-search--inline {
margin-bottom: 0;
}

.oo-poststuff .custom-input-field .chosen-container-single .chosen-single {
border-color: #8c8f94;
box-shadow: none;
border-radius: 3px;
padding: 0 24px 0 8px;
min-height: 30px;
/** fix shortened Placeholder in multiselect */
.oo-poststuff .custom-input-field .select2 .select2-selection .select2-search__field {
width: auto !important;
margin-top: 0;
}

.oo-poststuff .custom-input-field .select2 .select2-selection .select2-search__field::placeholder {
color: #999;
}

.oo-poststuff .custom-input-field input[name=oopluginlistviews-countryactive]:checked::before,
Expand Down
14 changes: 11 additions & 3 deletions css/onoffice-multiselect.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@
margin-top: 10px;
}

.select2-dropdown.select2-dropdown--below,
.select2-dropdown.select2-dropdown--above {
margin-top: 32px;
.select2-selection__choice {
display: flex;
}

.select2-selection__choice__remove:hover {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23666" d="M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z"/></svg>');
}

.select2-selection__choice__remove {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23999" d="M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z"/></svg>');
width: 16px;
}
2 changes: 1 addition & 1 deletion dist/checkbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/onoffice-custom-select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/onoffice-sort-by-user-selection.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions js/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,20 @@ onOffice.checkboxAdmin.prototype.changeCbStatus = function(topElement) {
var invert = receiver.invert;

if (receiverElement.length) {
var isChosen = receiverElement[0].classList.contains("chosen-select");
if (mainElement.prop('checked')) {
if (!invert) {
receiverElement[0].checked = receiverElement[0].checked || (receiver.checkOnActive && (instance._isInitialRun||fromOnChange));
receiverElement.removeAttr('disabled');
} else {
receiverElement.prop('disabled', 'disabled');
receiverElement.removeAttr('checked');
if (isChosen) {
receiverElement.trigger("chosen:updated");
}
}
} else {
if (!invert) {
receiverElement.prop('disabled', 'disabled');
receiverElement.removeAttr('checked');
} else {
receiverElement.removeAttr('disabled');
if (isChosen) {
receiverElement.trigger("chosen:updated");
}
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions js/onoffice-custom-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
onOffice = onOffice || {};
onOffice.custom_select2_translation = onOffice.custom_select2_translation || [];
jQuery(document).ready(function ($) {
const $multiSelectAdminSorting = $('#viewrecordssorting .oo-custom-select2.oo-custom-select2--multiple');
const $singleSelectAdminSorting = $("#viewrecordssorting .oo-custom-select2.oo-custom-select2--single");

$('.custom-multiple-select, .custom-single-select').select2({
width: '100%'
});

$multiSelectAdminSorting.select2({
placeholder: custom_select2_translation.multipleSelectOptions,
width: '50%'
});

$singleSelectAdminSorting.select2({
placeholder: custom_select2_translation.singleSelectOption,
width: '50%'
});
});
1 change: 0 additions & 1 deletion js/onoffice-sort-by-user-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jQuery(document).ready(function ($) {
}
});
}
standardSortInput.trigger("chosen:updated");
};

onOffice.sortingSelection = function (sortingSelectionVal) {
Expand Down
3 changes: 0 additions & 3 deletions plugin/Controller/AdminViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ public function enqueue_css()
{
wp_enqueue_style('onoffice-admin-css',
plugins_url('/css/admin.css', ONOFFICE_PLUGIN_DIR.'/index.php'));

wp_enqueue_style('chosen-admin-css',
plugins_url('/third_party/chosen/chosen.css', ONOFFICE_PLUGIN_DIR.'/index.php'));
}


Expand Down
Loading

0 comments on commit 4cbf33a

Please sign in to comment.