-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created & Styled FaceView custom view
- Loading branch information
1 parent
1b20082
commit 099b3db
Showing
5 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.stretch { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
div.face { | ||
float: left; | ||
margin-right: 5px; | ||
cursor: pointer; | ||
background: #fff static_url('brick.png') no-repeat; | ||
z-index: 50; | ||
padding: 4px; | ||
color: #fff; | ||
font: normal, Arial, Helvetica, sans-serif; | ||
font-size: 13px; | ||
} | ||
|
||
div.face-name { | ||
font-weight: bold; | ||
margin: 0; | ||
padding: 5px 10px 0 10px; | ||
width: 175px; | ||
height: 22px; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
text-align: left; | ||
font-size: 15px; | ||
line-height: 22px; | ||
color: #fff; | ||
} | ||
|
||
div.face-company { | ||
text-align: right; | ||
color: #CCC; | ||
font-weight: normal; | ||
font-size: 12px; | ||
width: 175px; | ||
padding: 0 10px; | ||
} | ||
|
||
div.face-bottom-overlay { | ||
background: transparent static_url('face_overlay_background.png'); | ||
height: 50px; | ||
left: -4px; | ||
position: relative; | ||
top: 146px; | ||
width: 199px; | ||
z-index: -1; | ||
} | ||
|
||
div.face-background { | ||
width: 195px; | ||
height: 195px; | ||
position: absolute; | ||
left: 0px; | ||
top: 0px; | ||
z-index: -10; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ========================================================================== | ||
// Project: Faces.FaceView Unit Test | ||
// Copyright: ©2010 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Faces module test ok equals same stop start */ | ||
|
||
module("Faces.FaceView"); | ||
|
||
// TODO: Replace with real unit test for Faces.FaceView | ||
test("test description", function() { | ||
var expected = "test"; | ||
var result = "test"; | ||
equals(result, expected, "test should equal test"); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// ========================================================================== | ||
// Project: Faces.FaceView | ||
// Copyright: ©2010 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Faces */ | ||
|
||
/** @class | ||
(Document Your View Here) | ||
@extends SC.View | ||
*/ | ||
Faces.FaceView = SC.View.extend( | ||
/** @scope Faces.FaceView.prototype */ { | ||
|
||
contentDisplayProperties: 'name company website picture'.w(), | ||
|
||
render: function(context, firstTime) { | ||
var content = this.get('content'); | ||
var name = content.get('name'); | ||
var company = content.get('company'); | ||
var website = content.get('website'); | ||
var picture = content.get('picture'); | ||
|
||
context = context.begin('div').addClass('face-bottom-overlay').push(''); | ||
context = context.begin('div').addClass('face-name').push(name).end(); | ||
context = context.begin('div').addClass('face-company').push(company).end(); | ||
context = context.end(); | ||
|
||
if (picture) { | ||
context = context.begin('div').addClass('face-background').push('<img src="' + picture + '" class="stretch" alt="" />').end(); | ||
} | ||
|
||
sc_super(); | ||
} | ||
|
||
}); |