Skip to content

Commit

Permalink
[UI] v5 and v6 icon style
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Jun 12, 2019
1 parent f363305 commit 97d5149
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/Resources/public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
background: url("/bundles/pimcoreadmin/img/flat-color-icons/binoculars.svg") center center no-repeat !important;
}

.pimcore_bundle_nav_icon_advancedObjectSearch {
background: url("/bundles/pimcoreadmin/img/flat-color-icons/binoculars.svg") center center no-repeat !important;
}

.pimcore_version_6 .pimcore_bundle_nav_icon_advancedObjectSearch {
background: url("/bundles/pimcoreadmin/img/flat-white-icons/binoculars.svg") center center no-repeat !important;
}

#pimcore_bundle_advancedObjectSearch_toolbar {
background-image: url(/bundles/pimcoreadmin/img/flat-color-icons/binoculars.svg) !important;
filter: grayscale(0%) !important;
Expand Down
31 changes: 21 additions & 10 deletions src/Resources/public/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pimcore.bundle.advancedObjectSearch.helper = {
if(!esSearchMenu) {
esSearchMenu = Ext.create('Ext.menu.Item', {
text: t("bundle_advancedObjectSearch"),
iconCls: "pimcore_bundle_advancedObjectSearch",
iconCls: "pimcore_bundle_nav_icon_advancedObjectSearch",
hideOnClick: false,
menu: {
cls: "pimcore_navigation_flyout",
Expand All @@ -41,15 +41,15 @@ pimcore.bundle.advancedObjectSearch.helper = {

esSearchMenu.getMenu().add({
text: t("bundle_advancedObjectSearch_new"),
iconCls: "pimcore_bundle_advancedObjectSearch",
iconCls: "pimcore_bundle_nav_icon_advancedObjectSearch",
handler: function () {
var esSearch = new pimcore.bundle.advancedObjectSearch.searchConfigPanel();
pimcore.globalmanager.add(esSearch.getTabId(), esSearch);
}
});
esSearchMenu.getMenu().add({
text: t("bundle_advancedObjectSearch_search"),
iconCls: "pimcore_bundle_advancedObjectSearch",
iconCls: "pimcore_bundle_nav_icon_advancedObjectSearch",
handler: function () {
new pimcore.bundle.advancedObjectSearch.selector(pimcore.bundle.advancedObjectSearch.helper.openEsSearch);
}
Expand All @@ -68,7 +68,7 @@ pimcore.bundle.advancedObjectSearch.helper = {
var id = rdata.entries[i].id;
esSearchMenu.getMenu().add({
text: rdata.entries[i].name,
iconCls: "pimcore_bundle_advancedObjectSearch",
iconCls: "pimcore_bundle_nav_icon_advancedObjectSearch",
handler: function (id) {
pimcore.bundle.advancedObjectSearch.helper.openEsSearch(id);
}.bind(this, id)
Expand All @@ -81,14 +81,25 @@ pimcore.bundle.advancedObjectSearch.helper = {
},

initializeStatusIcon: function() {
//adding status icon
var statusBar = Ext.get("pimcore_status");

var statusIcon = Ext.get(statusBar.insertHtml('afterBegin',
'<div id="pimcore_bundle_advancedObjectSearch_toolbar" data-menu-tooltip="'
+ t("bundle_advancedObjectSearch_updating_index") + '"></div>'));
var notificationMenu = pimcore.globalmanager.get("layout_toolbar")["notificationMenu"];

pimcore.helpers.initMenuTooltips();
if(notificationMenu) {
// Pimcore 6
var statusIcon = new Ext.menu.Item({
text: t("bundle_advancedObjectSearch_updating_index"),
iconCls: 'pimcore_bundle_nav_icon_advancedObjectSearch'
});
notificationMenu.add(statusIcon);
} else {
// Pimcore 5
var statusBar = Ext.get("pimcore_status");
var statusIcon = Ext.get(statusBar.insertHtml('afterBegin',
'<div id="pimcore_bundle_advancedObjectSearch_toolbar" data-menu-tooltip="'
+ t("bundle_advancedObjectSearch_updating_index") + '"></div>'));

pimcore.helpers.initMenuTooltips();
}

this.checkIndexStatus(statusIcon);
},
Expand Down

0 comments on commit 97d5149

Please sign in to comment.