11<template >
22 <div class =" btn-group" >
33 <button class =" btn btn-default dropdown-toggle" ref =" dropdownBtn" >
4- <i class =" fa" :class =" [usingBak && 'text-info', processingIcon || 'fa-cog']" ></i >
4+ <i class =" fa" :class =" [usingBak && 'text-info', processingCls || 'fa-cog']" ></i >
55 <span class =" caret" ></span >
66 </button >
77 <div class =" dropdown-menu p-10 clearfix" :style =" drpMenuStyle" >
88 <div class =" -col-group-container" >
9- <column-group v-for =" group in colGroups" :key =" group.groupName " ref =" colGroups" :col-group =" group" />
9+ <column-group v-for =" ( group, idx) in colGroups" :key =" idx " ref =" colGroups" :col-group =" group" />
1010 </div >
1111 <div class =" m-10 clearfix" >
1212 <div class =" btn-group btn-group-sm pull-right" >
1313 <button class =" btn btn-default" @click =" apply()" >
14- Apply
14+ {{ $i18n(' Apply') }}
1515 </button >
1616 <template v-if =" supportBackup " >
1717 <button data-toggle =" dropdown" class =" btn btn-default dropdown-toggle box-shadow-none" >
2121 <li @click =" apply(true)" >
2222 <a href =" javascript:;" >
2323 <i class =" fa fa-floppy-o" ></i >  ;
24- Apply and backup settings to local
24+ {{ $i18n(' Apply and backup settings to local') }}
2525 </a >
2626 </li >
2727 <li v-if =" usingBak" @click =" rmBackup()" >
2828 <a href =" javascript:;" >
2929 <i class =" fa fa-trash-o text-danger" ></i >  ;
30- Clear local settings backup and restore
30+ {{ $i18n(' Clear local settings backup and restore') }}
3131 </a >
3232 </li >
3333 </ul >
3434 </template >
3535 </div >
3636 </div >
37- <small v-if =" usingBak" class =" pull-left text-muted" >
38- ( Using local settings )
37+ <small v-if =" usingBak" class =" pull-left text-muted m-t--20 " >
38+ ( {{ $i18n(' Using local settings') }} )
3939 </small >
4040 </div >
4141 </div >
@@ -49,8 +49,8 @@ const stringify = JSON.stringify
4949const rmFromLS = k => LS .removeItem (k)
5050const saveToLS = (k , v ) => LS .setItem (k, stringify (v))
5151const getFromLS = k => { try { return parseStr (LS .getItem (k)) } catch (e) { rmFromLS (k) } }
52- // hashCode http://stackoverflow.com/a/15710692/5172890
5352const hash = s => ' ' + s .split (' ' ).reduce ((a , b ) => (a = (a << 5 ) - a + b .charCodeAt (0 ), a & a), 0 )
53+ // the hash algorithm above refers to http://stackoverflow.com/a/15710692/5172890
5454
5555export default {
5656 components: { ColumnGroup },
@@ -72,7 +72,7 @@ export default {
7272 return {
7373 origSettings,
7474 usingBak: false ,
75- processingIcon : ' ' ,
75+ processingCls : ' ' ,
7676 localKey: this .supportBackup && hash (origSettings) // key for local backup
7777 }
7878 },
@@ -86,7 +86,7 @@ export default {
8686 }
8787 },
8888 mounted () {
89- // control dropdown manually, refers to http://jsfiddle.net/rj3k550m/3
89+ // control dropdown manually ( refers to http://jsfiddle.net/rj3k550m/3)
9090 const $el = $ (this .$el )
9191 $ (this .$refs .dropdownBtn ).on (' click' , this .toggle )
9292 $ (document ).on (' click' , e => {
@@ -116,26 +116,26 @@ export default {
116116 },
117117 showProcessing () {
118118 [' fa-spinner fa-pulse' , ' fa-check' , ' ' ].forEach ((cls , idx ) => {
119- setTimeout (() => this .processingIcon = cls, idx * 1000 )
119+ setTimeout (() => this .processingCls = cls, idx * 1000 )
120120 })
121121 }
122122 }
123123}
124124 </script >
125125<style >
126- .overflow-auto {
127- overflow : auto ;
126+ .-col-group-container {
127+ border-bottom : 1 px solid #ddd ;
128128}
129129.p-10 {
130130 padding : 10px 10px 0 10px ;
131131}
132132.m-10 {
133133 margin : 10px ;
134134}
135+ .m-t--20 {
136+ margin-top : -20px ;
137+ }
135138.box-shadow-none {
136139 box-shadow : none !important ;
137140}
138- .-col-group-container {
139- border-bottom : 1px solid #ddd ;
140- }
141141 </style >
0 commit comments