1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00
This commit is contained in:
HarveyKandola 2018-07-28 11:43:45 -04:00
parent 743eae5aad
commit d0970c153b
8 changed files with 287 additions and 8 deletions

View file

@ -1,11 +1,11 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
// by contacting <sales@documize.com>.
//
// https://documize.com
@ -47,10 +47,25 @@ export default Service.extend({
schedule('afterRender', () => {
let elem = $(id).offset();
if (is.undefined(elem)) return;
$('html, body').animate({
scrollTop: elem.top
}, 250);
});
}
});
},
downloadFile(content, filename) {
let b = new Blob([content], {
type: 'text/html'
});
const data = window.URL.createObjectURL(b);
var link = document.createElement('a');
link.href = data;
link.download = filename;
link.click();
// For Firefox it is necessary to delay revoking the ObjectURL
setTimeout(function() { window.URL.revokeObjectURL(data), 100});
}
});