Commit 96d1e753 authored by Tristan Cavelier's avatar Tristan Cavelier

Conflict solver closes itself after solving

parent ade981ac
...@@ -21,20 +21,20 @@ window.basic_conflict_solver = { ...@@ -21,20 +21,20 @@ window.basic_conflict_solver = {
document.querySelector ('#basic_conflict_solver_div #revisions'). document.querySelector ('#basic_conflict_solver_div #revisions').
innerHTML += '<div class="row-fluid"><div class="span12">'+ innerHTML += '<div class="row-fluid"><div class="span12">'+
'<div><textarea id="'+revision+'">'+content+'</textarea></div>'+ '<div><textarea id="'+revision+'">'+content+'</textarea></div>'+
'<div><button onclick="console.log('+"'"+revision+"'"+');'+ '<div><button onclick="'+
'basic_conflict_solver.keepRevision('+"'"+revision+"'"+');'+ //'console.log('+"'"+revision+"'"+');'+
"basic_conflict_solver.keepRevision('"+revision+"');"+
'">Save this one</button></div><hr/>'+ '">Save this one</button></div><hr/>'+
// window.basic_conflict_solver.keepRevision('+
// '<div><button onclick="alert('+"'"+'cobra'+"'"+');'+
// "'"+revision+"'"+'); alert("after"); return false;">Save this one</button></div><hr/>'+
'</div></div>'; '</div></div>';
}, },
addRemovedRevision: function (revision) { addRemovedRevision: function (revision) {
document.querySelector ('#basic_conflict_solver_div #revisions'). document.querySelector ('#basic_conflict_solver_div #revisions').
innerHTML += '<div class="row-fluid"><div class="span12">'+ innerHTML += '<div class="row-fluid"><div class="span12">'+
'<div>Removed</div>'+ '<div>Removed</div>'+
'<div><button onclick="window.basic_conflict_solver.keepRevision('+ '<div><button onclick="'+
"'"+revision+"'"+'); return false;">Save this one</button></div><hr/>'+ //'console.log('+"'"+revision+"'"+');'+
"basic_conflict_solver.keepRevision('"+revision+"');"+
'">Save this one</button></div><hr/>'+
'</div></div>'; '</div></div>';
}, },
keepRevision: function (revision) { keepRevision: function (revision) {
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
<!-- <!--
window.OfficeJS_slickgrid = {}; window.OfficeJS_slickgrid = {};
window.OfficeJS_slickgrid.reload = function () { window.OfficeJS_slickgrid.reload = function () {
$('#myDocumentList').html('');
var grid, onSortFunction, onClickFunction, check_box_selector, var grid, onSortFunction, onClickFunction, check_box_selector,
onRemoveSeveral, showIconFormatter, onRemoveSeveral, showIconFormatter,
document_list = OfficeJS.cloneCurrentDocumentList(), document_list = OfficeJS.cloneCurrentDocumentList(),
......
...@@ -170,15 +170,15 @@ ...@@ -170,15 +170,15 @@
gadget_id:'page-content', gadget_id:'page-content',
interval_id:null, interval_id:null,
onload: function () { onload: function () {
var t = this;
if (this.interval_id === null) { if (this.interval_id === null) {
this.interval_id = setInterval (function() { this.interval_id = setInterval (function() {
that.getList(this.update); that.getList(t.update);
}, 5000); }, 5000);
} }
}, },
update: function () { update: function () {
OfficeJS.open({app:'document_lister',force:true}); window.OfficeJS_slickgrid.reload();
//window.OfficeJS_slickgrid.reload();
}, },
onunload: function () { onunload: function () {
if (this.interval_id !== null) { if (this.interval_id !== null) {
...@@ -406,6 +406,15 @@ ...@@ -406,6 +406,15 @@
} }
}; };
/**
* Load an empty page in the place of a specific gadget id
* @method closeGadgetId
* @param {string} gadgetid The gadget id
*/
that.closeGadgetId = function (gadgetid) {
TabbularGadget.addNewTabGadget('component/empty.html',gadgetid);
};
/** /**
* @method getPreference * @method getPreference
* @param {string} key The preference * @param {string} key The preference
...@@ -690,7 +699,7 @@ ...@@ -690,7 +699,7 @@
that.solveConflict = function (conflict_object, data) { that.solveConflict = function (conflict_object, data) {
// TODO : that.close basic_solver that.closeGadgetId (priv.data_object.currentSolver.gadget_id);
priv.data_object.currentEditor.setContent(data); priv.data_object.currentEditor.setContent(data);
priv.loading_object.save(); priv.loading_object.save();
conflict_object.solveConflict( conflict_object.solveConflict(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment