remove widget-15 from need_fix_containers and add filter JS
This commit is contained in:
parent
d7a936157d
commit
9ffe37a3e2
|
|
@ -342,7 +342,7 @@ class AnnouncementsController < ApplicationController
|
|||
"outDuration":"400",
|
||||
"inClass":"fade-in",
|
||||
"outClass":"fade-out",
|
||||
"need_fix_containers":".widget-announcement-4,.widget-announcement-15",
|
||||
"need_fix_containers":".widget-announcement-4",
|
||||
"linkElement": "[data-list=\"announcements\"] > *",
|
||||
"children_text_block": ".w-annc__content-wrap",
|
||||
"container_block": "[data-subpart-id=\"'+subpart.id.to_s+'\"] [data-list=\"announcements\"]:not(tbody)",
|
||||
|
|
|
|||
|
|
@ -1,25 +1,35 @@
|
|||
<div class="w-annc widget-announcement-4 w-annc widget-announcement-15" style="position:relative;">
|
||||
<div class="w-annc widget-announcement-15" style="position:relative;">
|
||||
<div class="w-annc__more-wrap clearfix">
|
||||
<h2 class="w-annc__widget-title">
|
||||
<h3 class="w-annc__widget-title">
|
||||
<span>{{widget-title}}</span>
|
||||
</h2>
|
||||
</h3>
|
||||
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}"><%= (I18n.locale.to_s =="zh_tw") ? "更多最新消息" : "More NEWS" %></a>
|
||||
</div>
|
||||
<div style="position: absolute;top: 50%;bottom: 50%;width:100%;">
|
||||
<button class="btn-left" title = "<%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %>" style="float: left;height: 2.5em; width: 2.5em;background: border: 0;background-size: contain;position: absolute;transition:.3s; left: 0.6%;color: #ffffff;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 50%;
|
||||
border: none;"><i class="fa fa-angle-left prev-button" aria-hidden="true" style="font-size: 1.5rem;"></i><span style="display: none;"><%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %></span></button>
|
||||
<button class="btn-right" title = "<%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %>" style="float: right;;height: 2.5em; width: 2.5em;background-size: contain;border: 0;position: absolute;transition:.3s;right: 0.6%;color: #ffffff;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 50%;
|
||||
border: none;"><i class="fa fa-angle-right next-button" aria-hidden="true" style="font-size: 1.5rem;"></i><span style="display: none;"><%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %></span></button>
|
||||
</div>
|
||||
<ul class="w-annc__list row" data-level="0" data-list="announcements">
|
||||
<li class="w-annc__item col-md-4">
|
||||
<div class="w-annc__img-wrap bullseye">
|
||||
<div style="position: absolute;top: 50%;width:100%; z-index: 101;">
|
||||
<div style="">
|
||||
<button id="prev-{{subpart-id}}" class="btn-left" title = "<%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %>" style="float: left;height: 2.5em; width: 2.5em;background: border: 0;background-size: contain;position: absolute;transition:.3s; left: 0.6%;color: #ffffff;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 50%;
|
||||
border: none; z-index: 2;"><i class="fa fa-angle-left prev-button" aria-hidden="true" style="font-size: 1.5rem;"></i><span style="display: none;"><%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %></span></button>
|
||||
<button id="next-{{subpart-id}}" class="btn-right" title = "<%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %>" style="float: right;;height: 2.5em; width: 2.5em;background-size: contain;border: 0;position: absolute;transition:.3s;right: 0.6%;color: #ffffff;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 50%;
|
||||
border: none; z-index: 2;"><i class="fa fa-angle-right next-button" aria-hidden="true" style="font-size: 1.5rem;"></i><span style="display: none;"><%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="w-annc__list row cycle-slideshow" data-level="0" data-list="announcements" data-cycle-fx="carousel"
|
||||
data-cycle-timeout="0"
|
||||
data-cycle-carousel-visible="3"
|
||||
data-cycle-carousel-fluid="true"
|
||||
data-cycle-next="#next-{{subpart-id}}"
|
||||
data-cycle-prev="#prev-{{subpart-id}}"
|
||||
data-cycle-slides=".w-annc__item" >
|
||||
<li class="w-annc__item " >
|
||||
<div class="w-annc__img-wrap bullseye" style="position:relative">
|
||||
<a href="{{link_to_show}}" aria-label="前往{{widget-title}}" title="{{widget-title}}">
|
||||
<img class="w-annc__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}">
|
||||
<div class="transitionfade"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="w-annc__content-wrap">
|
||||
<div class="w-annc__meta">
|
||||
|
|
@ -27,24 +37,40 @@
|
|||
<span class="w-annc__status label {{status-class}}">{{status}}</span>
|
||||
</span>
|
||||
<span class="w-annc__postdate-wrap" date-format="%Y-%m-%d">
|
||||
<i class="fa fa-calendar-o"></i>
|
||||
<i class="fa-regular fa-calendar"></i>
|
||||
<span class="w-annc__postdate">{{postdate}}</span>
|
||||
</span>
|
||||
<span class="w-annc__category-wrap">
|
||||
<i class="fa fa-tasks"></i>
|
||||
<i class="fa-solid fa-list"></i>
|
||||
<span class="w-annc__category">{{category}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<h4 class="w-annc__entry-title">
|
||||
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
|
||||
</h4>
|
||||
<p class="w-annc__subtitle">{{subtitle}}</p>
|
||||
<p class="w-annc__subtitle">{{subtitle}}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script src="//code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('[data-subpart-id="{{subpart-id}}"] .filter_tab').click(function(){
|
||||
var cat = $(this).data('category');
|
||||
$('[data-subpart-id="{{subpart-id}}"] .filter_tab').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('[data-subpart-id="{{subpart-id}}"] .w-annc__item').each(function(){
|
||||
if(cat == 'all' || $(this).data('category') == cat){
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- <script>
|
||||
function combineul_{{subpart-id}}(){
|
||||
var parents = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').parent();
|
||||
parents.each(function(i,v){
|
||||
|
|
@ -116,7 +142,7 @@
|
|||
num=1;
|
||||
}
|
||||
})
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
if($(window).width()>1024){
|
||||
reorganize_{{subpart-id}}(3);
|
||||
num=3;
|
||||
|
|
@ -168,4 +194,4 @@
|
|||
};
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script> -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue