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

Fix getImageAlignment for IE11 #1185

Merged
merged 4 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/build/gulp/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@ <h3>Full toolbar demo</h3>
- Frederico Knabben. All rights reserved.
</p>
</div>

<script src="//unpkg.com/svg4everybody@2.1.9/dist/svg4everybody.js"></script>
<script>svg4everybody();</script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this file should probably use tabs, but it seems the rest of it is currently using spaces, so the indentation looks a bit whack:

Fix_getImageAlignment_for_IE11_by_julien_·Pull_Request__1185·_liferay_alloy-editor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll fix that right now

</body>
</html>
7 changes: 7 additions & 0 deletions src/plugins/imagealignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ if (!CKEDITOR.plugins.get('ae_imagealignment')) {
imageAlignment = centeredImage ? IMAGE_ALIGNMENT.CENTER : null;
}

if (!CKEDITOR.env.edge && CKEDITOR.env.ie) {
const p = image.findOne('p');
if (p) {
imageAlignment = p.getStyle('text-align');
}
}

return imageAlignment;
};

Expand Down