Skip to content

Commit

Permalink
Small refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
julen committed Dec 27, 2012
1 parent a3b6053 commit 5d90739
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pootle/static/js/admin.js
Expand Up @@ -61,7 +61,8 @@ $(function () {

if ($('.js-edit-details').length) {
var $metaDesc = $('.js-ctx-meta-desc'),
$editMetaDesc = $('.js-edit-ctx-meta-desc');
$editMetaDesc = $('.js-edit-ctx-meta-desc'),
editMetaSelector = '#js-admin-edit-meta';

$metaDesc.on('click', '.js-edit-details', function (e) {
e.preventDefault();
Expand All @@ -76,7 +77,7 @@ $(function () {
$editMetaDesc.hide();
});

$editMetaDesc.on('submit', '#js-admin-edit-meta', function (e) {
$editMetaDesc.on('submit', editMetaSelector, function (e) {
e.preventDefault();

$editMetaDesc.spin();
Expand All @@ -91,15 +92,13 @@ $(function () {

$editMetaDesc.hide();
$editMetaDesc.html(data.form);
$editMetaDesc.spin(false);
$editMetaDesc.css({opacity: 1});

$metaDescContent.replaceWith(data.description_html);
$metaDesc.show();

$('.markup-body').filter(':not([dir])').bidi();
},
error: function () {
complete: function (xhr) {
$editMetaDesc.spin(false);
$editMetaDesc.css({opacity: 1});
},
Expand Down

0 comments on commit 5d90739

Please sign in to comment.