Bestfit mode only enabled for filetype:image
This commit is contained in:
parent
4bee0d69d3
commit
99f6dc1504
2 changed files with 19 additions and 14 deletions
16
sahli.coffee
16
sahli.coffee
|
|
@ -84,6 +84,7 @@ class @Sahli
|
|||
fname = @location + '/' + picdata.file
|
||||
pdiv = $('<div>')
|
||||
pdiv.addClass 'scrolly'
|
||||
pdiv.addClass 'image'
|
||||
pdiv.width picdata.width
|
||||
pdiv.css 'display', 'inline-block'
|
||||
pimg = $('<img src="' + fname + '" />')
|
||||
|
|
@ -95,13 +96,14 @@ class @Sahli
|
|||
@origwidth = picdata.width
|
||||
|
||||
@bestfit = =>
|
||||
if $('div.scrolly').hasClass('bestfit')
|
||||
$('div.scrolly').removeClass 'bestfit'
|
||||
$('div.scrolly').width @origwidth
|
||||
else
|
||||
$('h6').hide()
|
||||
$('div.scrolly').addClass 'bestfit'
|
||||
$('div.scrolly').width("");
|
||||
if $('div.scrolly').hasClass('image')
|
||||
if $('div.scrolly').hasClass('bestfit')
|
||||
$('div.scrolly').removeClass 'bestfit'
|
||||
$('div.scrolly').width @origwidth
|
||||
else
|
||||
$('h6').hide()
|
||||
$('div.scrolly').addClass 'bestfit'
|
||||
$('div.scrolly').width("");
|
||||
|
||||
@loadhugeansi = (picdata, inserthere) ->
|
||||
fname = @location + '/' + picdata.file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue