0
@@ -297,7 +297,7 @@ var ArticleForm = {
0
attachAsset: function(assetId) {
0
- var articleId = location.href.match(/\/(edit|upload)\/([0-9]+)/)[2];
0
+ var articleId = location.href.match(/\/([0-9]+)\/(edit|upload)/)[1];
0
var attached = $('attached-widget-' + assetId);
0
new Ajax.Request('/admin/articles/attach/' + articleId + '/' + assetId);
0
@@ -305,7 +305,7 @@ var ArticleForm = {
0
labelAsset: function(assetId) {
0
- var articleId = location.href.match(/\/(edit|upload)\/([0-9]+)/)[2];
0
+ var articleId = location.href.match(/\/([0-9]+)\/(edit|upload)/)[1];
0
var attached = $('attached-widget-' + assetId);
0
var label = $('attached-widget-version-' + assetId);
0
new Ajax.Request('/admin/articles/label/' + articleId + '/' + assetId + '?label=' + escape(label.value));
0
@@ -313,7 +313,7 @@ var ArticleForm = {
0
detachAsset: function(assetId) {
0
- var articleId = location.href.match(/\/(edit|upload)\/([0-9]+)/)[2];
0
+ var articleId = location.href.match(/\/([0-9]+)\/(edit|upload)/)[1];
0
var attached = $('attached-widget-' + assetId);
0
new Ajax.Request('/admin/articles/detach/' + articleId + '/' + assetId);
Comments
No one has commented yet.