From 35f5a7a7c28b275333cd129369de1a3c4d0c505a Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 24 Jan 2017 17:55:01 -0500 Subject: [PATCH] metacode image working a bit better --- app/assets/stylesheets/base.scss.erb | 56 ++++++++++++++++------------ frontend/src/components/TopicCard.js | 16 ++++---- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/app/assets/stylesheets/base.scss.erb b/app/assets/stylesheets/base.scss.erb index 499b92cd..84a2998f 100644 --- a/app/assets/stylesheets/base.scss.erb +++ b/app/assets/stylesheets/base.scss.erb @@ -191,15 +191,12 @@ background-color: #e0e0e0; .linkItem { - float:left; - height:46px; + float: left; z-index: 1; position: relative; color: #424242; font-size: 14px; - line-height:14px; - height:12px; - padding:17px 0; + line-height: 14px; a { color: #424242; @@ -207,36 +204,37 @@ } .icon { - position:absolute; - width:100%; - z-index:1; + position: absolute; + z-index: 1; padding: 0; height: 48px; - left: -16px; + width: 100%; + + .metacodeImage { + position: relative; + left: -16px; + } } .contributor { - margin-left: 24px; bottom: 7px; + margin-left: 20px; .contributorIcon { - display: inline-block; + position: relative; vertical-align: middle; - border-radius: 14px; + border-radius: 16px; margin: 5px; - } - span { - font-family: 'din-regular', sans-serif; - font-size: 14px; - } - - .contributorIcon { - position: absolute; top: 8px; left: 0; border-radius: 16px; } + span { + font-family: 'din-regular', sans-serif; + font-size: 14px; + } + .contributorName { display: none; position: absolute; @@ -249,8 +247,20 @@ font-size: 12px; padding: 3px 5px 2px; white-space: nowrap; - margin-top: 36px; - margin-left: -32px; + margin-top: 8px; + + &:before { + content: ''; + position: absolute; + top: 26px; + left: 10px; + margin-top: -30px; + width: 0; + height: 0; + border-bottom: 4px solid #000000; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + } } &:hover .contributorName { @@ -259,8 +269,6 @@ } .mapCount { - margin-left: 48px; - width: 24px; padding:17px 0 17px 36px; .mapCountIcon { diff --git a/frontend/src/components/TopicCard.js b/frontend/src/components/TopicCard.js index 43ba1fe8..5f3d5dfe 100644 --- a/frontend/src/components/TopicCard.js +++ b/frontend/src/components/TopicCard.js @@ -49,9 +49,8 @@ var funcs = { nodeValues.desc_html = Util.mdToHTML(nodeValues.desc_markdown) return nodeValues }, - bindShowCardListeners: function(topic) { - var self = TopicCard - + bindShowCardListeners: function(topic, ActiveMapper) { + var authorized = topic.authorizeToEdit(ActiveMapper) var selectingMetacode = false // attach the listener that shows the metacode title when you hover over the image $('.showcard .metacodeImage').mouseenter(function() { @@ -133,7 +132,7 @@ var funcs = { }) $('.metacodeSelect li li').click(metacodeLiClick) - var bipName = $(showCard).find('.best_in_place_name') + var bipName = $('.showcard').find('.best_in_place_name') bipName.bind('best_in_place:activate', function() { var $el = bipName.find('textarea') var el = $el[0] @@ -165,7 +164,7 @@ var funcs = { }) // this is for all subsequent renders after in-place editing the desc field - const bipDesc = $(showCard).find('.best_in_place_desc') + const bipDesc = $('.showcard').find('.best_in_place_desc') bipDesc.bind('ajax:success', function() { var desc = $(this).html() === $(this).data('bip-nil') ? '' @@ -218,7 +217,7 @@ var funcs = { } // ability to change permission var selectingPermission = false - if (topic.authorizePermissionChange(Active.Mapper)) { + if (topic.authorizePermissionChange(ActiveMapper)) { $('.showcard .yourTopic .mapPerm').click(openPermissionSelect) $('.showcard').click(hidePermissionSelect) } @@ -260,9 +259,10 @@ class ReactTopicCard extends Component { } componentDidMount = () => { - const { topic } = this.props + const { topic, ActiveMapper } = this.props embedly('on', 'card.rendered', this.embedlyCardRendered) topic.get('link') && topic.get('link') !== '' && this.loadLink() + funcs.bindShowCardListeners(topic, ActiveMapper) } componentWillUnmount = () => { @@ -363,7 +363,7 @@ class ReactTopicCard extends Component {
{values.map_count} -
Click to see which maps topic appears on
+
Click to see which maps topic appears on
    {values.inmaps}