DiverseYouthNightSchool/public/assets/js/manystore/general/profile.js

26 lines
971 B
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function ($, undefined, Backend, Table, Form, Upload) {
var Controller = {
index: function () {
// 给上传按钮添加上传成功事件
$("#plupload-avatar").data("upload-success", function (data) {
var url = Backend.api.cdnurl(data.url);
$(".profile-user-img").prop("src", url);
Toastr.success("上传成功!");
});
// 给表单绑定事件
Form.api.bindevent($("#update-form"), function () {
$("input[name='row[password]']").val('');
var url = Backend.api.cdnurl($("#c-avatar").val());
top.window.$(".user-panel .image img,.user-menu > a > img,.user-header > img").prop("src", url);
return true;
});
Form.api.bindevent($("#shop-form"));
},
};
return Controller;
});