Skip to content

Commit

Permalink
Merge pull request #855 from kossebau/fixTooSmallToolbarALittle
Browse files Browse the repository at this point in the history
Prevent editor toolbar being too small, at least for left-aligned elements
  • Loading branch information
Friedrich committed Jan 5, 2015
2 parents 60a1269 + c29f77c commit e7827ef
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ See also section about WebODF

* Fix wrongly enabled hyperlink tools with no document loaded ([#833](https://github.com/kogmbh/WebODF/pull/833))
* Prevent Cross-Site Scripting from style names and font names ([#849](https://github.com/kogmbh/WebODF/pull/849)))
* Avoid badly rendered toolbar element with subsets of tools ([#849](https://github.com/kogmbh/WebODF/pull/855)))

# Changes between 0.5.3 and 0.5.4

Expand Down
50 changes: 19 additions & 31 deletions programs/editor/Tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ define("webodf/editor/Tools", [
aboutButton = new Button({
label: tr('About WebODF Text Editor'),
showLabel: false,
iconClass: 'webodfeditor-dijitWebODFIcon',
style: {
float: 'left'
}
iconClass: 'webodfeditor-dijitWebODFIcon'
});
aboutDialog = new AboutDialog(function (dialog) {
aboutButton.onClick = function () {
Expand All @@ -159,33 +156,12 @@ define("webodf/editor/Tools", [
aboutButton.placeAt(toolbar);
}

// Undo/Redo
undoRedoMenu = createTool(UndoRedoMenu, args.undoRedoEnabled);

// Add annotation
annotationControl = createTool(AnnotationControl, args.annotationsEnabled);

// Simple Style Selector [B, I, U, S]
simpleStyles = createTool(SimpleStyles, args.directTextStylingEnabled);

// Paragraph direct alignment buttons
paragraphAlignment = createTool(ParagraphAlignment, args.directParagraphStylingEnabled);

// Paragraph Style Selector
currentStyle = createTool(CurrentStyle, args.paragraphStyleSelectingEnabled);

// Zoom Level Selector
zoomSlider = createTool(ZoomSlider, args.zoomingEnabled);

// Load
if (loadOdtFile) {
loadButton = new Button({
label: tr('Open'),
showLabel: false,
iconClass: 'dijitIcon dijitIconFolderOpen',
style: {
float: 'left'
},
onClick: function () {
loadOdtFile();
}
Expand All @@ -199,9 +175,6 @@ define("webodf/editor/Tools", [
label: tr('Save'),
showLabel: false,
iconClass: 'dijitEditorIcon dijitEditorIconSave',
style: {
float: 'left'
},
onClick: function () {
saveOdtFile();
onToolDone();
Expand Down Expand Up @@ -234,13 +207,28 @@ define("webodf/editor/Tools", [
disabled: true,
label: tr('Format'),
iconClass: "dijitIconEditTask",
style: {
float: 'left'
}
});
formatMenuButton.placeAt(toolbar);
}

// Undo/Redo
undoRedoMenu = createTool(UndoRedoMenu, args.undoRedoEnabled);

// Add annotation
annotationControl = createTool(AnnotationControl, args.annotationsEnabled);

// Simple Style Selector [B, I, U, S]
simpleStyles = createTool(SimpleStyles, args.directTextStylingEnabled);

// Paragraph direct alignment buttons
paragraphAlignment = createTool(ParagraphAlignment, args.directParagraphStylingEnabled);

// Paragraph Style Selector
currentStyle = createTool(CurrentStyle, args.paragraphStyleSelectingEnabled);

// Zoom Level Selector
zoomSlider = createTool(ZoomSlider, args.zoomingEnabled);

// hyper links
editHyperlinks = createTool(EditHyperlinks, args.hyperlinkEditingEnabled);

Expand Down
9 changes: 9 additions & 0 deletions programs/editor/wodotexteditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
text-align: center;
}

/* Fix toolbar not adapting size to floating toolbar elements */
.dijitToolbar:after {
content: ".";
visibility: hidden;
display: block;
height: 0;
clear: both;
}

.dijitDialog {
border: none !important;
box-shadow: 0 1px 50px rgba(0, 0, 0, 0.25) !important;
Expand Down

0 comments on commit e7827ef

Please sign in to comment.