problem-box.js 803 Bytes
/**
 * [帮助中心 常见问题弹框]
 * @author: wsl(shuiling.wang@yoho.cn)
 * @date: 2016/12/02
 */

var problemTpl = require('../../tpl/help/problem-box.hbs');

// 问题弹窗操作
var problemBox = function() {
    var $problemBox;

    $('.help-page').append(problemTpl());
    $problemBox = $('.problem-box');

    $problemBox.css({lineHeight: $(window).height() + 'px'});

    $('.problem a').on('click', function() {
        var ask = $(this).data('ask') || '';
        var answer = $(this).data('answer') || '';

        $problemBox.find('.a-area').html(ask);
        $problemBox.find('.q-area').html(answer);
        $problemBox.show();
    });

    $('.problem-box .close, .problem-box .mark').on('click', function() {
        $problemBox.hide();
    });
};

module.exports = problemBox;