new SSView(photo)
Create a new SSView
Parameters:
Name | Type | Description |
---|---|---|
photo |
app.SSPhoto | An app.SSPhoto |
- Source:
Properties:
Name | Type | Description |
---|---|---|
image |
Element | paper-image |
author |
Element | label |
time |
Element | label |
location |
Element | Geo location |
model |
Object | template item model |
url |
string | photo url, binding |
authorLabel |
string | author text, binding |
locationLabel |
string | location text, binding |
Members
-
<private, static, constant> _SCREEN_ASP :number
-
Aspect ratio of screen
Type:
- number
- Source:
Methods
-
<private, static> _isBadAspect(asp) → {boolean}
-
Determine if a photo would look bad zoomed or stretched on the screen
Parameters:
Name Type Description asp
number an aspect ratio
- Source:
Returns:
true if a photo aspect ratio differs substantially from the screens'
- Type
- boolean
-
<static> _showLocation() → {boolean}
-
Should we show the location, if available
- Source:
Returns:
true if we should show the location
- Type
- boolean
-
<static> createView(photo, sizing) → {app.SSView}
-
Factory Method to create a new app.SSView
Parameters:
Name Type Description photo
app.SSPhoto An app.SSPhoto
sizing
app.SSViews.Type photo sizing type
- Source:
Returns:
a new SSView or subclass
- Type
- app.SSView
-
<static> ignore(asp, photoSizing) → {boolean}
-
Determine if a given aspect ratio should be ignored
Parameters:
Name Type Description asp
number an aspect ratio
photoSizing
int the sizing type
- Source:
Returns:
true if the aspect ratio should be ignored
- Type
- boolean
-
<static> showTime() → {boolean}
-
Should we show the time
- Source:
Returns:
true if we should show the time
- Type
- boolean
-
_hasAuthor() → {boolean}
-
Does a photo have an author label to show
- Source:
Returns:
true if we should show the author
- Type
- boolean
-
_hasAuthorLabel() → {boolean}
-
Does a view have an author label set
- Source:
Returns:
true if author label is not empty
- Type
- boolean
-
_hasLocation() → {boolean}
-
Does a photo have a geolocation
- Source:
Returns:
true if geolocation point is non-null
- Type
- boolean
-
_hasLocationLabel() → {boolean}
-
Does a view have an location label set
- Source:
Returns:
true if location label is not empty
- Type
- boolean
-
_setAuthorLabel()
-
Set the author text
- Source:
-
_setLocationLabel()
-
Set the geolocation text
- Source:
-
_setTimeStyle()
-
Set the style for the time label
- Source:
-
_setUrl()
-
Set the url
- Source:
-
<private> _super500px()
-
Add superscript to the label for 500px photos
- Source:
-
isError() → {boolean}
-
Determine if a photo failed to load (usually 404 error)
- Source:
Returns:
true if image load failed
- Type
- boolean
-
isLoaded() → {boolean}
-
Determine if a photo has finished loading
- Source:
Returns:
true if image is loaded
- Type
- boolean
-
render()
-
Render the page for display - the default CSS is for our view subclasses override this to determine the look of photo
- Source:
-
setElements(image, author, time, location, model)
-
Set the elements of the view
Parameters:
Name Type Description image
Element paper-image, photo
author
Element div, photographer
time
Element div, current time
location
Element div, geolocation text
model
Object template item model
- Source:
-
setPhoto(photo)
-
Set the photo
Parameters:
Name Type Description photo
app.SSPhoto a photo to render
- Source: