Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove-w2ui #11: Mobile top bar #8673

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions browser/css/device-mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ textarea.cool-annotation-textarea {
top: -1px;
}
}
#tb_actionbar_item_redo.disabled, #tb_actionbar_item_undo.disabled, #tb_actionbar_item_mobile_wizard.disabled, #tb_actionbar_item_insertion_mobile_wizard.disabled {
#toolbar-up #redo.disabled, #toolbar-up #undo.disabled, #toolbar-up #mobile_wizard.disabled, #toolbar-up #insertion_mobile_wizard.disabled {
display: none;
}
#toolbar-wrapper.mobile{
Expand Down Expand Up @@ -217,7 +217,7 @@ nav:not(.spreadsheet-color-indicator) ~ #toolbar-wrapper #toolbar-up.w2ui-toolba
#toolbar-search {
height: 39px !important;
}
#tb_actionbar_item_fullscreen{display: none;}
#toolbar-up #fullscreen{display: none;}
#toolbar-down {
border-top: 1px solid var(--color-border) !important;
}
Expand Down Expand Up @@ -258,9 +258,6 @@ nav:not(.spreadsheet-color-indicator) ~ #toolbar-wrapper #toolbar-up.w2ui-toolba
width: 36px !important;
}

#tb_actionbar_item_userlist table{
margin: -1px 0px auto 3px !important;
}
#toolbar-up .checked{
border-color: transparent !important;
background: none !important;
Expand Down
25 changes: 15 additions & 10 deletions browser/src/control/Control.JSDialogBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* from the JSON description provided by the server.
*/

/* global app $ w2ui _ L JSDialog */
/* global app $ _ L JSDialog */

L.Control.JSDialogBuilder = L.Control.extend({

Expand Down Expand Up @@ -2320,14 +2320,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
// empty, So, we ignore such messages or else the
// current document's Paste toolbar button will
// never be enabled.
$(div).removeClass('disabled');
$(div).removeClass('disabled'); // TODO: remove after css rework
div.setAttribute('disabled', '');
window.app.console.log('do not disable paste based on server side data');
} else {
$(div).addClass('disabled');
$(div).addClass('disabled'); // TODO: remove after css rework
div.setAttribute('disabled', '');
}
}
else {
$(div).removeClass('disabled');
$(div).removeClass('disabled'); // TODO: remove after css rework
div.removeAttribute('disabled');
}
};

Expand All @@ -2345,8 +2348,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
}, this);
}

if (disabled)
L.DomUtil.addClass(div, 'disabled');
if (disabled) {
L.DomUtil.addClass(div, 'disabled'); // TODO: remove after css rework
div.setAttribute('disabled', '');
}

if (data.selected === true) {
$(button).addClass('selected');
Expand All @@ -2370,7 +2375,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
L.DomUtil.create('i', 'unoarrow', arrowbackground);
controls['arrow'] = arrowbackground;
$(arrowbackground).click(function (event) {
if (!$(div).hasClass('disabled')) {
if (!div.hasAttribute('disabled')) {
builder.callback('toolbox', 'openmenu', parentContainer, data.command, builder);
event.stopPropagation();
}
Expand All @@ -2382,7 +2387,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}

var clickFunction = function (e) {
if (!$(div).hasClass('disabled')) {
if (!div.hasAttribute('disabled')) {
builder.refreshSidebar = true;
if (data.postmessage)
builder.map.fire('postMessage', {msgId: 'Clicked_Button', args: {Id: data.id} });
Expand All @@ -2409,7 +2414,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
builder._preventDocumentLosingFocusOnClick(div);

if (data.enabled === 'false' || data.enabled === false)
$(button).prop('disabled', true);
div.setAttribute('disabled', '');

builder.map.hideRestrictedItems(data, controls['container'], controls['container']);
builder.map.disableLockedItem(data, controls['container'], controls['container']);
Expand Down Expand Up @@ -2750,7 +2755,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (builder.wizard) {
$(menuEntry).click(() => {
if (window.insertionMobileWizard)
w2ui['actionbar'].click('insertion_mobile_wizard');
app.dispatcher.dispatch('insertion_mobile_wizard');
else if (window.mobileMenuWizard)
$('#main-menu-state').click();
else if (window.contextMenuWizard) {
Expand Down