From 521944bf92d2c59a0d21051c3d15b51acee89917 Mon Sep 17 00:00:00 2001 From: Christopher De Cairos Date: Tue, 19 Feb 2013 14:50:26 -0500 Subject: [PATCH] [#3081] Make feed layout for twitter resizeable --- templates/assets/editors/twitter/twitter.js | 5 +++++ .../assets/plugins/twitter/popcorn.twitter.js | 22 +++++++++++++++++-- .../plugins/twitter/popcorn.twitter.less | 5 +---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/templates/assets/editors/twitter/twitter.js b/templates/assets/editors/twitter/twitter.js index 91e12e38f..9096e14f6 100644 --- a/templates/assets/editors/twitter/twitter.js +++ b/templates/assets/editors/twitter/twitter.js @@ -6,5 +6,10 @@ EditorHelper.addPlugin( "twitter", function( trackEvent ) { if ( trackEvent.popcornTrackEvent.layout === "feed" ) { EditorHelper.draggable( trackEvent, container, target ); + EditorHelper.resizable( trackEvent, container, target, { + handlePositions: "e,se,s", + minWidth: 30, + minHeight: 65 + }); } }); diff --git a/templates/assets/plugins/twitter/popcorn.twitter.js b/templates/assets/plugins/twitter/popcorn.twitter.js index 08efd8ca1..1db3b34d2 100644 --- a/templates/assets/plugins/twitter/popcorn.twitter.js +++ b/templates/assets/plugins/twitter/popcorn.twitter.js @@ -80,9 +80,20 @@ units: "%", "default": 0 }, + top: { + hidden: true, + elem: "input", + type: "number", + units: "%", + "default": 0 + }, width: { hidden: true, - "default": 35, + "default": 35 + }, + height: { + hidden: true, + "default": 100 }, zindex: { hidden: true @@ -126,7 +137,14 @@ options._container = document.createElement( "div" ); options._container.classList.add( "popcorn-twitter" ); options._container.id = Popcorn.guid( "twitter" ); - options._container.style.left = options.left + "%"; + + if ( options.layout && options.layout !== "ticker" ) { + options._container.style.left = ( options.left || options._natives.manifest.options.left.default ) + "%"; + options._container.style.top = ( options.top || options._natives.manifest.options.top.default ) + "%"; + options._container.style.height = ( options.height || options._natives.manifest.options.height.default ) + "%"; + options._container.style.width = ( options.width || options._natives.manifest.options.width.default ) + "%"; + } + options._container.style.zIndex = +options.zindex; titleText.classList.add( "popcorn-twitter-title" ); titleText.appendChild( document.createTextNode( options.search || options.username || "Twitter" ) ); diff --git a/templates/assets/plugins/twitter/popcorn.twitter.less b/templates/assets/plugins/twitter/popcorn.twitter.less index 49294a7f0..364c756ec 100644 --- a/templates/assets/plugins/twitter/popcorn.twitter.less +++ b/templates/assets/plugins/twitter/popcorn.twitter.less @@ -16,9 +16,6 @@ position: absolute; text-align: left; color: #555; - bottom: 0; - width: 35%; - height: 100%; background: #FEFEFE; background-clip: padding-box; border: 1px solid #DDD; @@ -28,7 +25,7 @@ display: block; padding: 0 @hpadding; height: @titleheight; - line-height: 2; + padding-top: 5px; font-weight: 700; background: #FFF url("twitter-icon.png") ( 100% - @hpadding ) center no-repeat; border-bottom: 1px solid #CCC;