mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Bug fixes for 'insert history' operation in pages.
This commit is contained in:
@@ -387,12 +387,14 @@ class HistoryController( BaseController ):
|
||||
def set_importable_async( self, trans, id=None, importable=False ):
|
||||
""" Set history's importable attribute. """
|
||||
history = get_history( trans, id, True )
|
||||
|
||||
if history:
|
||||
|
||||
# Only set if importable value would change; this prevents a change in the update_time unless attribute really changed.
|
||||
importable = importable in ['True', 'true', 't'];
|
||||
if history and history.importable != importable:
|
||||
history.importable = importable
|
||||
trans.sa_session.flush()
|
||||
|
||||
return
|
||||
return result
|
||||
|
||||
@web.expose
|
||||
def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ):
|
||||
|
||||
@@ -232,23 +232,29 @@
|
||||
|
||||
// Insert link.
|
||||
wym._exec(WYMeditor.CREATE_LINK, sStamp);
|
||||
if ( $("a[href=" + sStamp + "]", wym._doc.body).length != 0)
|
||||
{
|
||||
// Link created from selected text; add href and title.
|
||||
$("a[href=" + sStamp + "]", wym._doc.body)
|
||||
.attr(WYMeditor.HREF, '${h.url_for( controller='history', action='view' )}' + '?id=' + item_id)
|
||||
.attr(WYMeditor.TITLE, "History" + item_id);
|
||||
}
|
||||
else
|
||||
var link_text = $("a[href=" + sStamp + "]", wym._doc.body).text();
|
||||
if (
|
||||
link_text == "" // Firefox.
|
||||
||
|
||||
link_text == sStamp // Safari
|
||||
)
|
||||
{
|
||||
// User selected no text; create link from scratch and use default text.
|
||||
|
||||
// Get history name.
|
||||
$.get( '${h.url_for( controller='history', action='get_name_async' )}?id=' + item_id, function( history_name ) {
|
||||
var href = '${h.url_for( controller='history', action='view' )}?id=' + item_id;
|
||||
wym.insert("<a href='" + href + "'>History '" + history_name + "'</a>");
|
||||
wym.insert("<a href='" + href + "'>History '" + history_name + "'</a>nbsp;");
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Link created from selected text; add href and title.
|
||||
$("a[href=" + sStamp + "]", wym._doc.body)
|
||||
.attr(WYMeditor.HREF, '${h.url_for( controller='history', action='view' )}' + '?id=' + item_id)
|
||||
.attr(WYMeditor.TITLE, "History" + item_id);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
hide_modal();
|
||||
|
||||
Reference in New Issue
Block a user