wizard: hide styleupdate as well as stylenew.

Also hide calc style panel for now: incomplete.

Change-Id: I46fee97f5d029860a12e5f7215d830091c5f9bf0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89068
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
Michael Meeks 2020-02-20 03:24:54 +00:00
parent 6197b25959
commit c07f45e4e5
2 changed files with 12 additions and 53 deletions

View file

@ -85,55 +85,6 @@ describe('Apply/modify styles.', function() {
.should('have.attr', 'style', 'margin-bottom: 0in; line-height: 100%'); .should('have.attr', 'style', 'margin-bottom: 0in; line-height: 100%');
}); });
it('Modify existing style.', function() {
// Apply Title style
applyStyle('Title');
helper.copyTextToClipboard();
cy.get('#copy-paste-container p font')
.should('have.attr', 'face', 'Liberation Sans, sans-serif');
cy.get('#copy-paste-container p font font')
.should('have.attr', 'style', 'font-size: 28pt');
// Open mobile wizard
cy.get('#tb_actionbar_item_mobile_wizard')
.should('not.have.class', 'disabled')
.click();
// Apply italic
cy.get('#Italic')
.click();
// Close mobile wizard
cy.get('#tb_actionbar_item_mobile_wizard')
.click();
helper.copyTextToClipboard();
cy.get('#copy-paste-container p i')
.should('exist');
// Open mobile wizard
cy.get('#tb_actionbar_item_mobile_wizard')
.should('not.have.class', 'disabled')
.click();
cy.get('#StyleUpdateByExample')
.click();
// Clear formatting
applyStyle('Clear formatting');
// Apply Title style with italic font
applyStyle('Title');
helper.copyTextToClipboard();
cy.get('#copy-paste-container p i')
.should('exist');
});
it('New style item is hidden.', function() { it('New style item is hidden.', function() {
// New style item opens a tunneled dialog // New style item opens a tunneled dialog
// what we try to avoid. // what we try to avoid.
@ -143,7 +94,7 @@ describe('Apply/modify styles.', function() {
.click(); .click();
cy.get('#StyleUpdateByExample') cy.get('#StyleUpdateByExample')
.should('exist'); .should('not.exist');
cy.get('#StyleNewByExample') cy.get('#StyleNewByExample')
.should('not.exist'); .should('not.exist');

View file

@ -335,7 +335,7 @@ L.Control.MobileWizard = L.Control.extend({
else if (data.id === 'insertshape') { else if (data.id === 'insertshape') {
$('#mobile-wizard').addClass('shapeswizard'); $('#mobile-wizard').addClass('shapeswizard');
} }
if (this.map .getDocType() === 'spreadsheet') if (this.map.getDocType() === 'spreadsheet')
$('#mobile-wizard').css('top', $('#spreadsheet-row-column-frame').css('top')); $('#mobile-wizard').css('top', $('#spreadsheet-row-column-frame').css('top'));
else else
$('#mobile-wizard').css('top', $('#document-container').css('top')); $('#mobile-wizard').css('top', $('#document-container').css('top'));
@ -365,13 +365,21 @@ L.Control.MobileWizard = L.Control.extend({
var stylesIdx = this._findIdxInParentById(deck, 'StylesPropertyPanel'); var stylesIdx = this._findIdxInParentById(deck, 'StylesPropertyPanel');
var textName = 'TextPropertyPanel'; var textName = 'TextPropertyPanel';
var textIdx = this._findIdxInParentById(deck, textName); var textIdx = this._findIdxInParentById(deck, textName);
if (stylesIdx >= 0 && textIdx >= 0)
if (stylesIdx >= 0 && this.map.getDocType() === 'spreadsheet')
{ // remove rather useless styles panel
deck.children.splice(stylesIdx, 1);
}
else if (stylesIdx >= 0 && textIdx >= 0)
{ {
var moveContent = deck.children[stylesIdx].children[0].children; var moveContent = deck.children[stylesIdx].children[0].children;
deck.children[textIdx].children[0].children = moveContent.concat(deck.children[textIdx].children[0].children); deck.children[textIdx].children[0].children = moveContent.concat(deck.children[textIdx].children[0].children);
deck.children.splice(stylesIdx, 1); //remove the styles property deck.children.splice(stylesIdx, 1); //remove the styles property
} }
this._removeItems(deck, ['cellbordertype', 'borderlinestyle', 'borderlinecolor', 'editcontour', 'spacingbar', 'linespacing', 'stylenew', 'beginarrowstyle', 'endarrowstyle']); this._removeItems(deck, ['cellbordertype', 'borderlinestyle', 'borderlinecolor',
'editcontour', 'spacingbar', 'linespacing',
'stylenew', 'styleupdate',
'beginarrowstyle', 'endarrowstyle']);
} }
}, },