MCPcopy Create free account
hub / github.com/devforth/painterro / save

Method save

js/main.js:848–882  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

846 }
847
848 save() {
849 if (this.saving) {
850 return this;
851 }
852 this.saving = true;
853 const btn = this.baseEl.querySelector(`#${this.toolByName.save.buttonId}`);
854 const icon = this.baseEl.querySelector(`#${this.toolByName.save.buttonId} > i`);
855 if (this.toolByName.save.buttonId && btn) {
856 btn.setAttribute('disabled', 'true');
857 }
858 this.hasUnsaved = false;
859
860 if (icon) {
861 icon.className = 'ptro-icon ptro-icon-loading ptro-spinning';
862 }
863
864 if (this.params.saveHandler !== undefined) {
865 this.params.saveHandler(this.imageSaver, (hide) => {
866 if (hide === true) {
867 this.hide();
868 }
869 if (icon) {
870 icon.className = 'ptro-icon ptro-icon-save';
871 }
872 this.saving = false;
873 });
874 } else {
875 logError('No saveHandler defined, please check documentation');
876 if (icon) {
877 icon.className = 'ptro-icon ptro-icon-save';
878 }
879 this.saving = false;
880 }
881 return this;
882 }
883
884 close() {
885 if (this.params.onClose !== undefined) {

Callers 6

constructorMethod · 0.95
initEventHandlersMethod · 0.95
binary_saverFunction · 0.80
applyFilterMethod · 0.80
constructorMethod · 0.80
handleMouseMoveMethod · 0.80

Calls 2

hideMethod · 0.95
logErrorFunction · 0.90

Tested by

no test coverage detected