Skip to content

Commit

Permalink
fixed merge conflict again with build + files
Browse files Browse the repository at this point in the history
  • Loading branch information
olavognild committed Jul 24, 2018
1 parent 59d7502 commit a6a57c5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DEPENDENCIES
scss_lint

RUBY VERSION
ruby 2.4.0p0
ruby 2.5.1p57

BUNDLED WITH
1.15.1
1.16.2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To run docs website locally:
Run `npm run build`

## License information ##
Code copyright 2017, SiteVision AB. Code is released under the [MIT license](https://github.com/sitevision/envision/blob/master/LICENSE)
Code copyright 2017-2018, SiteVision AB. Code is released under the [MIT license](https://github.com/sitevision/envision/blob/master/LICENSE)

## Supported browsers ##
Envision supports the **latest, stable releases** of all major browsers.
Expand Down
6 changes: 3 additions & 3 deletions _docs/components/modal-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ Uses `env-modal-dialog__dialog--small`
## Methods ##

Show
`$('#myModal').envModalDialog('show')`
`$('#myModal').envDialog('show')`

Hide
`$('#myModal').envModalDialog('hide')`
`$('#myModal').envDialog('hide')`

Toggle
`$('#myModal').envModalDialog('toggle')`
`$('#myModal').envDialog('toggle')`

## Events ##
`hide.env-modal-dialog`
Expand Down
7 changes: 3 additions & 4 deletions docs/assets/envision/envision.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/assets/envision/envision.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/components/modal-dialog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -673,13 +673,13 @@ <h6 class="env-text env-modal-dialog__header__title">Modal Header</h6>
<h2 id="methods">Methods</h2>

<p>Show<br />
<code class="highlighter-rouge">$('#myModal').envModalDialog('show')</code></p>
<code class="highlighter-rouge">$('#myModal').envDialog('show')</code></p>

<p>Hide <br />
<code class="highlighter-rouge">$('#myModal').envModalDialog('hide')</code></p>
<code class="highlighter-rouge">$('#myModal').envDialog('hide')</code></p>

<p>Toggle <br />
<code class="highlighter-rouge">$('#myModal').envModalDialog('toggle')</code></p>
<code class="highlighter-rouge">$('#myModal').envDialog('toggle')</code></p>

<h2 id="events">Events</h2>
<p><code class="highlighter-rouge">hide.env-modal-dialog</code></p>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/popover/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ <h4 class="env-text env-popover__header__title">Popover</h4>
Hover OR focus me!
<span class="nt">&lt;/button&gt;</span></code></pre></div>

<p>To keep the popover alive when being hovered it requires a slight delay to function properly. Use <code class="highlighter-rouge">data-delay="{amount}"</code>.</p>
<p>To keep the popover alive when being hovered it requires a delay to function properly. Use <code class="highlighter-rouge">data-delay="{amount}"</code>.</p>

<div class="code-example" data-example-id="">
<button class="env-button env-button--primary example-popover" data-placement="top" data-trigger="hover" data-title="Lorem ipsum" data-delay="500" data-content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. In fermentum nunc bibendum laoreet malesuada. Proin eget augue tortor. Sed bibendum cursus eros, vitae mattis leo laoreet eget.">
Expand Down
14 changes: 10 additions & 4 deletions src/js/image-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ const Imageviewer = (($) => {
this.$btnContainer.append(this.$imgContainer);
this.$modal.appendTo(document.body);

this.$btnContainer.append(this._getIndicators());

if (this.$images.length > 1) {
this.$btnContainer.append(this._getButtons());
this.$btnContainer.append(this._getIndicators());
}

this.$btnContainer.addClass(ClassName.HIDDEN);
Expand Down Expand Up @@ -141,6 +140,7 @@ const Imageviewer = (($) => {

_loadImage(href) {
const $downloadingImage = $('<img>');
const $imageModal = $('.env-image-viewer__dialog');

$downloadingImage
.addClass('env-image-viewer__img')
Expand All @@ -149,10 +149,17 @@ const Imageviewer = (($) => {
src: href
})
.on('load', () => {

const imageHeight = $downloadingImage.height();
const imageWidth = $downloadingImage.width();
const windowHeight = window.innerHeight;
const heightModifier = 0.8;
const defaultWidth = 800;

if (imageWidth > defaultWidth) {
$imageModal.css({
'max-width': '80%'
});
}

if (windowHeight < imageHeight) {
$downloadingImage.css({
Expand Down Expand Up @@ -338,4 +345,3 @@ const Imageviewer = (($) => {
})(jQuery);

export default Imageviewer;

0 comments on commit a6a57c5

Please sign in to comment.