CSS position fixed moved childrens - html

I'm trying to create chat just like facebook or google. I have created chat-container class which holds users list and chat boxes.
chat-container is fixed with bottom:0 and right: 0, so its position is perfect.
.chat-container {
position: fixed;
bottom: 0;
right: 0;
padding: 5px;
}
The problem is that I am getting a lot of users from server. So, I would like to add max-height: value. When I add this property then all my chat-boxes include userslist is being misaligned.
Each chat box has class chat-box and and inside chat-body..chat-box
.chat-box {
display: inline-block;
max-width: 300px;
min-width: 100px;
}
.chat-body {
max-width: 500px;
min-width: 100px;
overflow-y: scroll;
max-height: 200px;
}
How can I solve that?
EDIT - HTML:
<div class="chat-container">
<div class="chat-box" *ngFor="let chat of openedChats; let first = first;">
<p-panel [toggleable]="true">
<p-header>
<a class="ui-panel-titlebar-icon ui-panel-titlebar-toggler ui-corner-all ui-state-default" (click)="onCloseChat(chat)">
<span class="fa fa-fw fa-close"></span>
</a>
<b>{{chat.recipient.name}}</b>
</p-header>
<div class="chat-body" #chatbody>
<div *ngFor="let message of chat.messages">
<!--TODO: Get current user id | change to ngClass-->
<div *ngIf="message.sender.id != loggedUserId" class="chat-inner-message">
{{message.message}}
</div>
<div *ngIf="message.sender.id == loggedUserId" class="chat-my-message">
{{message.message}}
</div>
</div>
</div>
<hr>
<input type="text" class="chat-input" (keyup.enter)="onSendMessage(messageInput, chat.recipient.id)" #messageInput>
<button pButton type="button" label="Send" (click)="onSendMessage(messageInput, chat.recipient.id)" style="width:100%"></button>
<!--<span *ngIf='first'>{{setChatInputFocus()}}</span>-->
</p-panel>
</div>
<div class="chat-box">
<p-panel [toggleable]="true" [collapsed]="true">
<p-header>
Chat
</p-header>
<ul class="ultima-menu">
<li *ngFor="let user of visibleUsers" (click)="onUserSelected($event, user.id)" style="padding: 3%">
<div style="display: inline; cursor: pointer;">
<div>
<img style="vertical-align:middle" src="{{user?.settings?.photoSrc}}" class="circular-portrait" width="30px" height="30px"
alt="{{user.name}}">
<span>
{{user.name}} {{user.surname}}
</span>
</div>
</div>
</li>
</ul>
<hr>
<input pInputText placeholder="Search" [ngModel]="userTypeaheadText" (ngModelChange)="userTypeahedChanged($event)">
</p-panel>
</div>
</div>

Related

Display Transfers Button at the far right corner

<div class="account-tile" qa-name="accountBlock">
<a
*ngIf="link"
class="account-detail-header"
[routerLink]="'/AccountDetails/' + account.index!"
>
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
<span>
<i class="gg-chevron-right"></i>
</span>
</a>
<div *ngIf="!link" class="account-detail-header">
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
</div>
<div class="available-balance-container">
<div class="flex">
<span class="negative-account" *ngIf="account.availableBalance! < 0"
>-</span
>
<span
[ngClass]="link ? 'format-dollar-link' : 'format-dollar-display'"
class="format-dollar"
>
$
</span>
<h2 qa-name="availableBalance">
{{ account.availableBalance | currency: '':'' | absolute }}
</h2>
<!--This is wheere the transfer button appears-->
<div class="parent=class">
<button class="button-right pull-right">Transfer</button>
</div>
</div>
<h3>Available Balance</h3>
</div>
</div>
I am trying to display a transfer button at the right corner to look like the picture above. How can I accomplish that? I tried creating a button and a class that pulls the button to the right. when I compile the code, the transfer button shows underneath the Account amount
You can add position: absolute to your transfer button.
.parent-class {
position: relative;
height: 100px;
border: 1px solid red;
}
.button-right {
position: absolute;
right: 10px;
}
<div class="parent-class">
<button class="button-right">Transfer</button>
</div>

Set fixed divs regardless of the size of the content

I'm developing an item list that is filled dinnamically with some data that is getting from a controller.
I had a problem when the data is shown because I need to show it into two columns (called "record_left_content" and "record_right_content"), but when the obtained text is too long, the two columns are merged into one.
Someone knows how to positionate the both colums in a fixed way regardless of the size of the text/content ?
Code:
<div class="col-lg-9" id="middle_column">
<div class="text-center text-muted" t-if="not education_timetable_ids">
<h1>No timetables found</h1>
</div>
<div class="text-center text-muted" t-else="">
<ul class="list-unstyled">
<li t-foreach="education_timetable_ids" t-as="timetable" t-attf-class="media">
<div itemscope="itemscope" class="media-body" itemtype="https://schema.org/learningResourceType" >
<h4>
<a t-attf-href="/" itemprop="url" onclick="return false"><span itemprop="schedule"><t t-esc="timetable.display_name" /> </span></a>
</h4>
<div id="record_left_content">
<div>
<span t-if="timetable.academic_year_id" class="badge badge-info">
<i class="fa fa-clock-o" role="img" aria-label="Academic year" title="Academic year"></i>
Academic year:
<t t-esc="timetable.academic_year_id.name" />
</span>
//more code
<div id="record_right_content">
//more code
</div>
.media {
padding: 10px;
background-color: #e9ecef;
border-radius: 0.25rem;
margin: 10px;
}
#record_left_content {
float: left;
margin-left: 20%;
}
#record_right_content {
float: right;
margin-right: 20%;
}
Thanks for reading!

Box in css gets colored in a square shape instead of skewed

I'm working on a website. I'm coloring the menu items, but when coloring in the top left image (background color), it gets colored in square.
I would like to have it colored in skewed, so that it follows the black outline.
A screenshot of the problem and some of the html:
Is there anything I could do to make this work?
The html code of the bar:
<div class="iwgh2-bar">
<div class="iw2-layout iw2-default-breakpoint">
<div class="iw2-wrapper iw2-default-margin">
<div class="iw2-inner-wrapper">
<div class="iwgh2-navigation">
<a class="iw2-branded" href="https://www.vlaanderen.be/nl" target="_self">
<div class="iwgh2-branding-logo"></div>
<span>Vlaanderen</span>
</a>
<div class="iw2-menu iw2-menu-has-items" data-show-menu-help="Toon navigatie menu" data-hide-menu-help="Verberg navigatie menu">
<div class="iwgh2-navigation-menu-toggle-wrapper">
<div class="iwgh2-navigation-menu-toggle-animation-wrapper" style="">
<a class="iwgh2-navigation-menu-site" style="" href="http://binnenland.vlaanderen.be">Agentschap Binnenlands Bestuur</a>
<a class="iwgh2-navigation-menu-breadcrumb" style="" href="http://www.gelijkekansen.be">Gelijke Kansen</a>
<a class="iwgh2-navigation-menu-toggle iw2-exclude-from-outbound-link-tracking" href="javascript:;" aria-expanded="false" aria-owns="64ed92f1-fece-e61f-2d15-0af8093d9040" aria-controls="64ed92f1-fece-e61f-2d15-0af8093d9040"><span class="iw2-visually-hidden iw2-help-text"> Toon navigatie menu </span></a>
</div>
</div>
<div class="iwgh2-flyout-wrapper iw2-window-closed" style="display: none; left: 375.4px;" tabindex="-1" id="64ed92f1-fece-e61f-2d15-0af8093d9040">
<div class="iwgh2-search iw2-hidden" role="search">
<div class="iwgh2-form-label">
<label for="iwgh2-search-field">Zoeken</label>
</div>
<div class="iwgh2-form-textfield">
<input id="iwgh2-search-field" class="iwgh2-search-field iwgh2-form-text" name="query" type="search">
</div>
<div class="iwgh2-form-actions">
<div class="iwgh2-form-action">
<div class="iwgh2-form-button">
<input class="iwgh2-form-submit" name="op" value="" type="submit">
</div>
</div>
</div>
</div>
<ul class="iw2-menu-items" tabindex="-1">
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://lokaalbestuur.vlaanderen.be" target="_self">Lokaal Bestuur</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://www.thuisindestad.be" target="_self">Vlaams Stedenbeleid</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://integratiebeleid.vlaanderen.be" target="_self">Integratie en Inburgering</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://www.vlaamserand.be" target="_self">Beleid Vlaamse Rand</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://brussel.vlaanderen.be/home.html" target="_self">Beleid Brussel</a></li>
</ul>
</div>
</div>
</div>
<div class="iwgh2-extensions">
<div class="iwgh2-extension-contact" data-show-menu-help="Toon menu" data-hide-menu-help="Verberg menu">
<a class="iwgh2-extension-contact-toggle iw2-exclude-from-outbound-link-tracking" href="http://www.gelijkekansen.be/Praktisch/Contact.aspx" target="_self" aria-owns="906864c8-0db7-9b35-52ce-143b0e4d962a" aria-controls="906864c8-0db7-9b35-52ce-143b0e4d962a" aria-expanded="false"><span class="iw2-visually-hidden iw2-help-text"> Toon menu </span>Contacteer ons</a>
<div class="iwgh2-extension-contact-wrapper iwgh2-flyout-wrapper">
<div class="iwgh2-contact-menu iw2-window-closed iw2-menu-has-items" style="display:none;" tabindex="-1" id="906864c8-0db7-9b35-52ce-143b0e4d962a">
<div class="iwgh2-contact-menu-header">
<span class="iw2-menu-item-title">Gelijke kansen</span>
</div>
<ul class="iw2-menu-items">
<li class="iw2-menu-item iw2-contact-section-entry iw2-contact-section-entry-icon-link iw2-contact-section-entry-type-link"><a class="iw2-menu-item-wrapper" href="http://www.gelijkekansen.be/Praktisch/Contact.aspx" target="_self"><span class="iw2-menu-item-title">Contacteer ons</span>
<div class="iw2-menu-item-description"></div>
</a></li>
<li class="iw2-menu-item iw2-contact-section-entry iw2-contact-section-entry-icon-link iw2-contact-section-entry-type-link"><a class="iw2-menu-item-wrapper" href="http://binnenland.vlaanderen.be/klachten" target="_self"><span class="iw2-menu-item-title">Klachten</span>
<div class="iw2-menu-item-description">Waar kan ik terecht met een klacht?</div>
</a></li>
</ul>
</div>
<div class="iwgh2-windows">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
css:
.iwgh2.iwgh2-redesign .iwgh2-bar {
background-color: #fff;
border-bottom: 1px solid #cbd2da;
}
.iwgh2.iwgh2-redesign.iwgh2-default-margin .iw2-layout .iw2-wrapper.iw2-default-margin {
padding: 0;
}
.iwgh2-bar .iw2-wrapper {
*zoom: 1;
position: relative;
}
.iw2-wrapper .iw2-inner-wrapper {
position: relative;
}
.iwgh2-navigation {
float: left;
white-space: nowrap;
}
.iwgh2.iwgh2-redesign .iwgh2-navigation>a {
color: #333332;
font-size: 1.1875em;
line-height: 2.31579em;
text-transform: none;
transition: color 0.2s;
}
.iwgh2.iwgh2-redesign.iwgh2-redesign-alt .iwgh2-branding-logo {
position: relative;
width: 47px;
background-color: #FFE507;
overflow: hidden;
}
.iwgh2 .iw2-menu {
display: inline-block;
vertical-align: bottom;
position: relative;
}
.iwgh2.iwgh2-redesign.iwgh2-default-margin .iw2-layout {
max-width: none;
}
.iwgh2-bar .iw2-layout {
position: relative;
overflow: visible;
}
Take a look at this fiddle and see if that is what you wanted
#trapezoid {
border-bottom: 100px solid #FFE507;
border-right: 25px solid transparent;
height: 0;
width: 100px;
}
https://jsfiddle.net/CaffeinatedCod3r/r7deqakL/
More CSS Shapes : https://css-tricks.com/the-shapes-of-css/

Need to add editable text (metadata) for new as well as previously uploaded images

I need to add editable text field to have 'Caption' for each uploaded file. User may provide Captions at the time of upload;but, need option to provide Captions after uploading all of their images or update captions on already uploaded images.
I was able to get the get Caption data and set that as metadata in S3 using below:
JS segment:
callbacks: {
onUpload: function(id, fileName) {
var caption = document.getElementById('caption').value;
this.setParams({'caption':caption});
}
}
Template:
<script type="text/template" id="qq-template-manual-trigger-section1">
<div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drop files here">
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
</div>
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
<span class="qq-upload-drop-area-text-selector"></span>
</div>
<div class="buttons">
<div class="qq-upload-button-selector qq-upload-button">
<div>Select files</div>
</div>
<button type="button" id="trigger-upload-section1" class="btn btn-primary">
<i class="icon-upload icon-white"></i> Upload
</button>
</div>
<span class="qq-drop-processing-selector qq-drop-processing">
<span>Processing dropped files...</span>
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
</span>
<ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
<li>
<div class="qq-progress-bar-container-selector">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale>
<span class="qq-upload-file-selector qq-upload-file"></span>
<span class="qq-edit-filename-icon-selector qq-edit-filename-icon qq-editable" aria-label="Edit filename"></span>
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
<span class="qq-upload-caption-selector qq-upload-caption"></span>
<span class="qq-edit-caption-icon-selector qq-edit-caption-icon qq-editable" aria-label="Edit caption"></span>
<input class="qq-edit-caption-selector qq-edit-caption qq-editing" placeholder="Caption here ..." tabindex="0" type="text" id="caption">
<span class="qq-upload-size-selector qq-upload-size"></span>
<button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel">Cancel</button>
<button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry">Retry</button>
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">Delete</button>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
</li>
</ul>
<dialog class="qq-alert-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Close</button>
</div>
</dialog>
<dialog class="qq-confirm-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">No</button>
<button type="button" class="qq-ok-button-selector">Yes</button>
</div>
</dialog>
<dialog class="qq-prompt-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<input type="text">
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Cancel</button>
<button type="button" class="qq-ok-button-selector">Ok</button>
</div>
</dialog>
</div>
</script>
In a effort to make Caption input field to behave/function like filename, I have defined following Style
INPUT.qq-edit-caption {
position: absolute;
opacity: 0;
filter: alpha(opacity=0);
z-index: -1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
.qq-edit-caption-icon.qq-editable {
display: inline-block;
cursor: pointer;
}
INPUT.qq-edit-caption.qq-editing {
position: static;
height: 28px;
padding: 0 8px;
margin-right: 10px;
margin-bottom: -5px;
border: 1px solid #ccc;
border-radius: 2px;
font-size: 16px;
opacity: 1;
filter: alpha(opacity=100);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
.qq-edit-caption-icon {
display: none;
background: url("edit.gif");
width: 15px;
height: 15px;
vertical-align: text-bottom;
margin-right: 16px;
}
My questions and advice needed for the following:
I tried my best to make Caption field to behave like filename such
as onclick Edit text field will appear. Defined caption field very
similar to filename. Not sure how I can apply style 'qq-editing' to edit Caption? And, apply 'qq-hide' as needed. Any help is much appreciated.
How can user edit Caption on previously uploaded files?
I tried few hack steps (one being, tried to use Delete endpoint by passing diff param) to send Caption to server and nothing is
working for me; Really need expert advise on how I can use edit/update caption already uploaded files .

how to switch to another view using css class on click in angularjs using ngclass

I want to change the middle view of the current view when the links are clicked. one link is to view the iphone and the other one is to view the tablet. Default view should be iphone. Other than that anything in the view should not be changed with the click. I don't want to toggle between the views. Just load the view with the click on the link.
Below is the html code which I tried.
<div class="mobile-area">
<p>Mobile App</p>
<a class="mobile-icon current-device" href ng-click="iphoneView= !iphoneView"></a>
<a href ng-click="tabletView = !tabletView" class="tablet-icon"></a>
</div>
<div class="mobile-preview" ng-class="{'iphone': iphoneView}">
<div class="mobile-wrapper">
<div class="mobile-simulator">
<me-iphone tmp-url="{{appTemplateUrl}}"></me-iphone>
</div>
</div>
</div>
<div class="mobile-preview" ng-class="{'tablet': tabletView}">
<div class="mobile-wrapper">
<div class="mobile-simulator">
<me-tablet tmp-url="{{appTemplateUrl}}"></me-tablet>
</div>
</div>
</div>
Below is the css code.
.iphone {
position: relative;
background: url(../../../../images/iphone-bg.png) no-repeat;
width: 100%;
height: 100%;
padding-top: 58%;
border-radius: 1em;
float: none;
}
.tablet {
position: relative;
background: url(../../../../images/tablet.jpg) no-repeat;
width: 200%;
height: 100%;
padding-top: 58%;
border-radius: 1em;
float: none;
}
I tried different methods but nothing is working for me. Please tell me a way to load the views without toggling to the same html page.
Try this:
ng-class="tabletView ? 'tablet' : 'iphone'"
Default will be iphone. You don't need second iphoneView variable at all (if you have just these 2 views).
Try this?
<div class="mobile-area">
<p>Mobile App</p>
<a class="mobile-icon current-device" href ng-click="iphoneView=true;tabletView=false"></a>
<a href ng-click="tabletView=true;iphoneView=false" class="tablet-icon"></a>
</div>
<div class="mobile-preview" ng-class="{'iphone': iphoneView, 'tablet': tabletView}">
<div class="mobile-wrapper">
<div class="mobile-simulator">
<me-iphone ng-show="iphoneView" tmp-url="{{appTemplateUrl}}"></me-iphone>
<me-tablet ng-show="tabletView" tmp-url="{{appTemplateUrl}}"></me-tablet>
</div>
</div>
</div>
EDIT: according to karaxuna's answer, you can use just one variable
<div class="mobile-area">
<p>Mobile App</p>
<a class="mobile-icon current-device" href ng-click="tabletView=false"></a>
<a href ng-click="tabletView=true" class="tablet-icon"></a>
</div>
<div class="mobile-preview" ng-class="tabletView ? 'tablet' : 'iphone'">
<div class="mobile-wrapper">
<div class="mobile-simulator">
<me-iphone ng-show="!tabletView" tmp-url="{{appTemplateUrl}}"></me-iphone>
<me-tablet ng-show="tabletView" tmp-url="{{appTemplateUrl}}"></me-tablet>
</div>
</div>
</div>