forked from openlp/openlp
Lose the [None] and fix jquery issue
This commit is contained in:
parent
218ee2db2b
commit
031525b0e6
@ -506,18 +506,18 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
# multiple service items?
|
# multiple service items?
|
||||||
if self.singleServiceItem or self.remoteTriggered:
|
if self.singleServiceItem or self.remoteTriggered:
|
||||||
log.debug(u'%s Add requested', self.plugin.name)
|
log.debug(u'%s Add requested', self.plugin.name)
|
||||||
self.addToService([None], self.remoteTriggered)
|
self.addToService(replace=self.remoteTriggered)
|
||||||
else:
|
else:
|
||||||
items = self.listView.selectedIndexes()
|
items = self.listView.selectedIndexes()
|
||||||
self.addToService(items)
|
for item in items:
|
||||||
|
self.addToService(item)
|
||||||
|
|
||||||
def addToService(self, items, replace=None):
|
def addToService(self, item=None, replace=None):
|
||||||
for item in items:
|
serviceItem = self.buildServiceItem(item, True)
|
||||||
serviceItem = self.buildServiceItem(item, True)
|
if serviceItem:
|
||||||
if serviceItem:
|
serviceItem.from_plugin = False
|
||||||
serviceItem.from_plugin = False
|
self.parent.serviceManager.addServiceItem(serviceItem,
|
||||||
self.parent.serviceManager.addServiceItem(serviceItem,
|
replace=replace)
|
||||||
replace=replace)
|
|
||||||
|
|
||||||
def onAddEditClick(self):
|
def onAddEditClick(self):
|
||||||
"""
|
"""
|
||||||
|
@ -247,8 +247,11 @@ window.OpenLP = {
|
|||||||
var text = JSON.stringify({"request": {"id": id}});
|
var text = JSON.stringify({"request": {"id": id}});
|
||||||
$.getJSON(
|
$.getJSON(
|
||||||
"/api/" + $("#search-plugin").val() + "/add",
|
"/api/" + $("#search-plugin").val() + "/add",
|
||||||
{"data": text})
|
{"data": text},
|
||||||
history.back();
|
function () {
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ class HttpConnection(object):
|
|||||||
plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
|
plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
|
||||||
if plugin.status == PluginStatus.Active and plugin.mediaItem:
|
if plugin.status == PluginStatus.Active and plugin.mediaItem:
|
||||||
item_id = plugin.mediaItem.createItemFromId(id)
|
item_id = plugin.mediaItem.createItemFromId(id)
|
||||||
plugin.mediaItem.addToService([item_id])
|
plugin.mediaItem.addToService(item_id)
|
||||||
|
|
||||||
def send_response(self, response):
|
def send_response(self, response):
|
||||||
http = u'HTTP/1.1 %s\r\n' % response.code
|
http = u'HTTP/1.1 %s\r\n' % response.code
|
||||||
|
Loading…
Reference in New Issue
Block a user