Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover final #383

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Popover final #383

wants to merge 18 commits into from

Conversation

krshubham
Copy link
Contributor

In this PR, respective html and css for the popover were added in the corresponding files.
Future work:

  • Improving the style of the popover with matching theme for Teem
  • Caching of meta data for different links to provide quick access to the og data on subsequent requests
  • Popover should not hide on mouseover

let btn = event.target;
//cannot inject the spinner HTML directly here
let inHTML = `
<style>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style should go to a sass file, thanks!

margin: 150px 0;
}
</style>
<div class="pos-r">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Html should be written in a template file :)

let clientRect = range.node.nextSibling ?
range.node.nextSibling.getBoundingClientRect() :
range.node.parentElement.getBoundingClientRect();
div.innerHTML = inHTML;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style to sass file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved almost all the styles to sass only what seemed as necessary to me is kept here

</svg>
</div>
</div>`;
<div class="pos-r">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html to templates

else {
div.style.height = '110px';
innerEle.innerHTML = document.getElementById('no-title-in-url').innerHTML;
innerEle.querySelector('#popoverLinkTitle').innerHTML = urlTitle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why not use angular to populate the title, description, etc. with {{popover.title}} and similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I'll surely do that! Poor me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not working, idk I checked this but it didn't seem to work. in pad.js I made $scope.popover = { }and then populated this object with popover data but in template when I wrote {{popover.title}} it rendered nothing! I didn't get any errors even!



function linkPreview($http) {
const LINK_PREVIEW_SERVER_URL = 'http://localhost:9090/fetch';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server URL to config file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, i'll update the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need your help here ! @atfornes ! What would be the best way to do this?

@@ -66,3 +66,41 @@
</div>

</div>

<div style="display: none;">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style in sass files is preferred over inline style. Thanks!

@@ -227,7 +227,7 @@ div
position: absolute
border: 1px solid $grey
z-index: 3
background-color: lightgrey
background-color: darken(#fff, 5%)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to use one of our colors as $light-grey?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a bit more darker than what I wanted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colors have been carefully chosen by our designer @elenamv to combine together. Please see if there is a lighter color in our selection that you can use, maybe $pale-blue?

@atfornes
Copy link
Contributor

atfornes commented Sep 1, 2017

Sorry, I see now that some of the comments I did were not yet sent

Copy link
Contributor

@atfornes atfornes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments, please check them @krshubham.

gulpfile.js Outdated
@@ -220,7 +220,16 @@ var gulp = require('gulp'),
spawn = require('child_process').spawn,
gutil = require('gulp-util');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes in gulpfile should go to the pull request about error handling in gulp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be fixing this soon! Sorry about this, I didn't check that I had updated gulpfile here

<div id="popover">
<div class="popover-link-title" id="popoverLinkTitle"></div>
<div class="popover-link-image">
<img src="" alt="" height="180" width="330" id="popoverLinkImage">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, remove inline css and bring it to style files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry :( ! I'll push the changes soon.

@atfornes
Copy link
Contributor

atfornes commented Sep 4, 2017

@krshubham, this pull request still have unattended comments, please answer them. When can we expect the updated pull request?

@atfornes
Copy link
Contributor

atfornes commented Sep 5, 2017

a clean version of this pull request is merged at https://github.com/Grasia/teem/tree/krshubham-popover-final

Please @krshubham, open an issue that links to all the issues remaining in this branch. In order to merge, some things have to be still fixed, for instance, the popover hiding when the mouse is over it.

@krshubham
Copy link
Contributor Author

krshubham commented Sep 5, 2017

Okay, I'll open an issue listing all the work that should be done ! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants