Add read more display none option.

This commit is contained in:
BoHung Chiu 2023-02-18 08:19:42 +08:00
parent 9c7c25bd98
commit 74dbad4a5b
4 changed files with 30 additions and 25 deletions

View File

@ -417,10 +417,12 @@ class AnnouncementsController < ApplicationController
if (@read_more_option != 0 rescue false)
extra_html += "
<script style=\"display:none\">
$(document).ready(function(){
var read_more_position = #{@read_more_option};
var read_more_block = $(\"[data-subpart-id=\\\"#{subpart.id}\\\"] .w-annc__more\");
if(read_more_position == 5){
read_more_block.css('display', 'none');
}else{
if(read_more_position == 1 || read_more_position == 2){
read_more_block.addClass(\"pull-left\");
}else{
@ -444,6 +446,7 @@ class AnnouncementsController < ApplicationController
read_more_block.appendTo(div_clearfix);
$(\"[data-subpart-id=\\\"#{subpart.id}\\\"] > *:eq(-1)\").after(div_clearfix);
}
}
})
</script>
"
@ -491,7 +494,7 @@ class AnnouncementsController < ApplicationController
def get_tabs_option
subpart = OrbitHelper.get_current_widget
tab_options = ["not_enable_tabs","enable_tabs_with_categories_include_all","enable_tabs_with_categories"]
read_more_options = ['default','upper_left','lower_left','upper_right','lower_right']
read_more_options = ['default','upper_left','lower_left','upper_right','lower_right', 'display_none']
all_setting_options = ['the_same_as_data_count','display_all_in_other_tabs']
@tab_option = 0
@read_more_option = 0

View File

@ -39,10 +39,11 @@ en:
display_all_in_other_tabs: Display all contents in other tabs
read_more_position_options: '"read more" button position'
default: Default
upper_left: Upper left
lower_left: Lower left
upper_right: Upper right
lower_right: Lower right
upper_left: Upper Left
lower_left: Lower Left
upper_right: Upper Right
lower_right: Lower Right
display_none: Display None
tabs_options: Tabs options
not_enable_tabs: Not enable tabs
enable_tabs_with_categories_include_all: Enable tabs with categories(include all)

View File

@ -44,6 +44,7 @@ zh_tw:
lower_left: 左下
upper_right: 右上
lower_right: 右下
display_none: 隱藏
tabs_options: 頁籤選項
not_enable_tabs: 無頁籤
enable_tabs_with_categories_include_all: 開啟頁籤(依類別,並包含全部所選類別之頁籤)

View File

@ -24,7 +24,7 @@ module Announcement
value2_item2 = {}
key1_options = ['small_size','medium_size','orignal_size']
key2_options = ['not_enable_tabs','enable_tabs_with_categories_include_all','enable_tabs_with_categories']
key3_options = ['default','upper_left','lower_left','upper_right','lower_right']
key3_options = ['default','upper_left','lower_left','upper_right','lower_right', 'display_none']
key4_options = ['the_same_as_data_count','display_all_in_other_tabs']
key1_options.each_with_index do |k,i|
key1_attr[i] = {}