In my project (laravel+vuejs) i want to list the gantt chart of each project so when i click to the link of a specific project it redirect me to his gantt But in my case the the first click it work fine but one i click to choose other project it just change the url and dont refreshing the page (it didnt redirect me) it always work with the just first try.Any help guys?
this is the MainApp.vue:
<ul class="nav nav-treeview" >
<li class="nav-item" v-for="projet in projects.projets" :key="projet.id" v-if="currentUser.role==='admin'">
<router-link :to="`/gantt/${projet.id}`" class="nav-link ">
<i class="fas fa-circle" style="color:#05dfd7"> </i>
<p>Gantt:{{ projet.name }} </p>
</router-link>
</li>
</ul>
You need to add a :key attribute to your <router-view>
<router-view :key="$route.fullPath"></router-view>
Your ${projet.id} will be different each time, hence reload will be triggered.
Edit
$route.fullPath Vue API
type: string
The full resolved URL including query and hash.
Related
I have the follwing html on my site's header
<header>
<div class="logo_container">
<a href="/">
<img src="xxx" alt="">
</a>
</div>
<nav class="">
<ul>
<li>
<a href="xxx" title="xxxx" >xxx</a>
</li>
<li>
<a href="xxxx" title="xxx" >xxx</a>
</li>
<li>
xxx
</li>
<li>
</ul>
</nav>
<div class="toggle_menu" role="button" aria-label="open menu" tabindex="1"><em class="fa-solid fa-bars"></em>
</div>
</header>
At this header the nav is hiding on mobile device and shows up when the user press the div.toggle_menu.
The way this is read by VoiceOver screen reader of iphone 14, is "Button, open menu, end banner".
I would like it to say just "open menu". So I remove the role button and left only the aria-label="open menu".
Now it reads just "End of banner". Νο "Open menu" or "button".
I am quite new on aria and I am not sure what do I have to do.
Any help is appreciated.
To make it short: You shouldn’t do that. There is a good reason screen readers read the way they do and you should respect that. Its users rely on that.
That being said, it’s great that you are diving into ARIA and caring about screen reader’s experience.
Role
The role is very important for screen reader users, to know what to expect in terms of interaction and keyboard control. Roles communicate interaction patterns.
The whole point of ARIA is to add meaning to otherwise meaningless elements, where you cannot use the proper HTML element.
By removing the role, you are leaving a meaningless <div>, which might be focusable, but it would be way less intuitive to screen reader users to know how to interact with it. Assistive technology couldn’t know what it’s good for, voice control software would probably not let you click on it.
The accessible name provided by aria-label cannot be used on any element. The role determines if the name should (or must) be used or not. VoiceOver will not announce names for meaningless elements like <div>.
Tabindex 1
By adding tabindex="1", you are putting the button before any other focusable page contents, which messes with the expected focus order.
I guess you placed it so that you could have the button after the navigation. But a large part of screen reader users are sighted, and rely on contents exposed by their screen reader to match with what they can see. The logo comes before the button, and it would be irritating if it’s not focused first.
Refer to the ARIA Authoring Practices Guide
When it comes to your toggle button, you should implement the ARIA pattern, which requires not only the role button, but also aria-expanded to explain to assistive technology that the button opens and closes something, and its state.
The button should be before the contents that get expanded.
See Disclosure (Show/Hide) on the ARIA Authoring Practices Guide (APG)
<header>
<div class="logo_container">
<a href="/">
<img src="xxx" alt="Home, ACME">
</a>
</div>
<button class="toggle_menu" aria-label="open menu" aria-expanded="false"><em class="fa-solid fa-bars"></em></button>
<nav hidden>
<ul>
<li>
xxx
</li>
<li>
xxx
</li>
<li>
xxx
</li>
<li>
</ul>
</nav>
</header>
I have few dropdowns on my page, with buttons opening and closing a dropdown. Everything goes well after initial page load, but after changing to a different page, the dropdown opens with a click, but never closes. It seems that button's aria-expanded is stuck on true and the dropped down div has classes collapse open, which tries to collapse but won't ever do it (clicking the button gives the div collapsing class and then returns).
I have no idea why this happens and and if it's got to do with Liferay, freemarker, css or any of those...
This is my application display template:
<div id="a_language_selector">
<button
aria-controls="a_language_list"
aria-expanded="false"
role="button"
data-toggle="collapse"
data-target="#a_language_list"
>
<!-- CHANGE THIS -->
<#liferay.language key="EN" />
</button>
<ul
id="a_language_list"
class="panel-collapse collapse"
aria-labelledby="a_language_list"
>
<#if entries?has_content>
<#list entries as navigationEntry>
<li aria-label="${navigationEntry.getName()}">
<a href="${navigationEntry.getURL()}">
${navigationEntry.getName()}
</a>
</li>
</#list>
</#if>
</ul>
</div>
The answer was found and has to do with Liferay's own javascript (SennaJS)!
Changing a page in Liferay doesn't update the whole site and leaves old information lying around the session, breaking the collapsing.
I added this line to my portal-ext.properties and while it now loads after all page changes, it works well!
javascript.single.page.application.enabled=false
More information found here (help.liferay.com)
I'm trying to add Google Analytics click tracking events to li list items (active thumbnails) used in a responsive grid application, and can't get it working. I've researched here and in the Google developer forums without success. I'm sure there is something simple I'm doing wrong. I have the latest GA script code installed (page view analytics are working fine). Here is a code sample:
<ul>
<li data-type="link" data-url="http://www.dianagabaldon.com/books/outlander-series/" data-target="_self" >
</li>
<li data-thumbnail-path="outlander_files/thumbnails/outlanderbookseries1.png" ></li>
<li data-thumbnail-text >
<p class="largeLabel" >Diana Gabaldon - Outlander Series</p></li>
</ul>
Hope you can help. Feel free to suggest a better way of doing it.
Update: I'm still digging, and the GA code has been updated for Universal Analytics and looks like this:
<ul>
<li data-type="link" data-url="http://www.dianagabaldon.com/books/outlander-series/" data-target="_self" >
</li>
<li data-thumbnail-path="outlander_files/thumbnails/outlanderbookseries1.png" ></li>
<li data-thumbnail-text >
<p class="largeLabel" >Diana Gabaldon - Outlander Series</p></li>
</ul>
Update 2: I tried opening the outbound link target in a new page to see if a lack of callBack might be the problem. No success. Following are two views of the code, one with the contained inside the li with the outbound link, the other in a separate li with the same parent ul. Neither works. Does anyone know which syntax is correct? Thx.
Example 1: With href in it's own li:
<ul>
<li></li>
<li data-type="link" data-url="http://www.dianagabaldon.com/books/outlander-series/" data-target="_blank" ></li>
<li data-thumbnail-path="outlander_files/thumbnails/outlanderbookseries1.png" ></li>
<li data-thumbnail-text >
<p class="largeLabel" >Diana Gabaldon - Outlander Series</p></li>
</ul>
Example 2: With href inside outbound link li:
<ul>
<li data-type="link" data-url="http://www.starz.com/outlandercommunity/home.html" data-target="_blank" >
</li>
<li data-thumbnail-path="outlander_files/thumbnails/community1.png" ></li>
<li data-thumbnail-text >
<p class="largeLabel" >Starz: Outlander Community</p></li>
</ul>
The syntax you are using for the event tracking uses the classic GA syntax (_gaq.push), but if you are using Universal Analytics (assuming that is what you mean by using the "latest GA script code"), the syntax needs to be updated:
onClick="ga('send', 'event', 'GridLinks', 'Click', 'Outlander Clicks 1');"
I'm not familiar with Responsive Grid, but the likely explanation is that the call to ga only adds the event to a queue for asynchronous processing, and that the event is lost because the current document is immediately replaced afterwards (stopping the JavaScript execution for the current page). You would need to use a hit callback as described in the Google Analytics help, but I'm not sure how this would be integrated with Responsive Grid. Also note that there are a couple of other pitfalls you need to be aware of.
I am really new to JHipster. I am writing an application based on the JHipster Template. The JHipster template comes up with a lot of languages but I only need a few of them. My question is how can I delete the other one without getting errors. I can't just delete the menu entries. Because they come from Cookies and are initialized with the following coed.
<li class="dropdown pointer" ng-controller="LanguageController">
<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
<span>
<span class="glyphicon glyphicon-flag"></span>
<span class="hidden-tablet" translate="global.menu.language">Language</span>
<b class="caret"></b>
</span>
</a>
<ul class="dropdown-menu">
<li active-menu="{{key}}" ng-repeat="(key, language) in languages">
{{language}}
</li>
</ul>
</li>
Does someone now where those Cookies are initialized and how I can delete the other languages?
You can delete them, indeed. Have a look at the constants.js file.
In the next version we will make this easier, as indeed we are now having too many languages!
I'm working on a Blogger template with custom social sharing buttons. The problem I'm having is adding the Current Blog URL to the link.
Here is my code:
<li class="googleplus"><span>Google+</span></li>
If I leave it like that, then when I click to share the webpage, it actually shows data:blog.url, instead of the actual webpage URL.
I tried using:
<li class="googleplus"><a expr:href="https://plus.google.com/share?url=data:blog.url"><span>Google+</span></a></li>
However, that just makes the whole menu not appear at all(even omitted from source).
Is there a solution for this, or am I gonna have to use jQuery to grab the URL and insert it into the link?
This is what i use and it works perfectly
expr:share_url='data:post.url'
OR
<li class='google'>
<a expr:href='"https://plus.google.com/share?url=" + data:post.url' onclick='javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;' rel='nofollow' title='Share this on Google+'>
<strong>
Google+
</strong>
</a>
</li>
use this code :
<a expr:href='"https://plus.google.com/share?url=" + data:post.url.canonical' expr:onclick='"window.open(this.href, \"_blank\", \"height=430,width=640\"); return false;"' target='_blank'><span>Google+</span></a>