1 function updateAlbumBtnClick(albumId, albumName, albumDesc, updateCallback) {
\r
2 var dialogHolder = $('<div id="dialogHolderForUpdateAlbum"></div>');
\r
3 $(document.body).append(dialogHolder);
\r
4 var dialog = renderTemplate('#dialogHolderForUpdateAlbum', '#editAlbumDialogTemplate', { name: albumName, description: albumDesc });
\r
5 dialog = dialog.mDialog({ width: 420, height: 280 });
\r
7 $('#newAlbumName').on('keyup', function (eventObject) {
\r
8 var target = $(eventObject.target);
\r
9 var text = target.val();
\r
10 if (text && text.length > 12) {
\r
11 target.val(text.substring(0, 12));
\r
15 $('#editAlbumBtn').on('click', function () {
\r
16 var name = $.trim($('#newAlbumName').val());
\r
18 blinkInput('#newAlbumName');
\r
21 var desc = $.trim($('#newComment').val());
\r
23 ajaxUpdateAlbum(true, albumId, name, desc, function () {
\r
24 updateCallback(name, desc);
\r
25 dialog.destroyDialog();
\r
26 dialogHolder.remove();
\r
27 }, function (errorCode) {
\r
28 handleSensitiveWord(errorCode, '抱歉,专辑名包含非法字符,请修改后再分享。');
\r