...
|
...
|
@@ -23,8 +23,12 @@ var defaultWord = $spreadWord.data('word'); |
|
|
require('../common');
|
|
|
require('yoho-jquery-qrcode');
|
|
|
|
|
|
function reseatWordSize() {
|
|
|
$spreadWord.css('font-size', 22 + parseInt((14 - $spreadWord.text().length) / 7, 10) * 4);
|
|
|
function reseatWordSize(word) {
|
|
|
if (!word) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$spreadWord.css('font-size', 22 + parseInt((14 - word.length) / 7, 10) * 4);
|
|
|
}
|
|
|
|
|
|
function saveTrendWord(dg) {
|
...
|
...
|
@@ -50,8 +54,8 @@ function saveTrendWord(dg) { |
|
|
}).done(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$spreadWord.text(word);
|
|
|
reseatWordSize();
|
|
|
defaultWord = word;
|
|
|
reseatWordSize(defaultWord);
|
|
|
|
|
|
dg.close && dg.close();
|
|
|
} else {
|
...
|
...
|
@@ -85,20 +89,21 @@ clipboard.on('success', function() { |
|
|
}, 2000);
|
|
|
});
|
|
|
|
|
|
$editBtn.on('click', function() {
|
|
|
$editBtn.on('click', function(e) {
|
|
|
var _d = new Dialog({
|
|
|
content: trendWordTpl({
|
|
|
img: $spreadWord.data('img'),
|
|
|
word: defaultWord,
|
|
|
content: reasonHtml
|
|
|
}),
|
|
|
className: 'edit-trend-word-dg',
|
|
|
className: 'edit-trendword-dialog',
|
|
|
btns: [
|
|
|
{
|
|
|
id: 'trend-edit-cancel',
|
|
|
btnClass: ['trend-edit-cancel'],
|
|
|
name: '暂不',
|
|
|
cb: function() {
|
|
|
if (!window.cookie('no_cue_trendword')) {
|
|
|
if (e.isTrigger && !window.cookie('no_cue_trendword')) {
|
|
|
window.setCookie('no_cue_trendword', 1, {expires: 30});
|
|
|
}
|
|
|
_d.close();
|
...
|
...
|
@@ -116,7 +121,7 @@ $editBtn.on('click', function() { |
|
|
}).show();
|
|
|
});
|
|
|
|
|
|
reseatWordSize();
|
|
|
reseatWordSize(defaultWord);
|
|
|
|
|
|
if (!defaultWord && !window.cookie('no_cue_trendword')) {
|
|
|
$editBtn.trigger('click');
|
...
|
...
|
|