File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,25 @@ FilePond.create(getImageEntryElement, {
123123 // set the image source to the output of the Image Transform plugin
124124 img . src = URL . createObjectURL ( output ) ;
125125 imageSRC = img . src ;
126+
127+ // function to enable the get result button once image uploade d
128+ function enableImgResultBtn ( ) {
129+ let getPicResultBtn = document . querySelector ( '[data-button="pic-text"]' ) as HTMLButtonElement ;
130+
131+ getPicResultBtn . style . pointerEvents = '' ;
132+
133+ }
134+ enableImgResultBtn ( ) ;
135+
136+ // disable btn also when close btn clicked on image display
137+ let closeBtn = document . querySelector ( '.filepond--action-remove-item' ) as HTMLButtonElement ;
138+
139+ closeBtn . addEventListener ( 'click' , function ( ) {
140+ let getPicResultBtn = document . querySelector ( '[data-button="pic-text"]' ) as HTMLButtonElement ;
141+
142+ getPicResultBtn . style . pointerEvents = 'none' ;
143+ } )
144+
126145 console . log ( fileItem ) ;
127146 } ,
128147} ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ export function picTextGenerator(image: string): void {
1919 getPicTextResult ( attribute , outputNode ) ;
2020}
2121
22+ // function to disable the get result button once page loads
23+
24+ function disableImgResultBtn ( ) {
25+ let getPicResultBtn = document . querySelector ( '[data-button="pic-text"]' ) as HTMLButtonElement ;
26+
27+ getPicResultBtn . style . pointerEvents = 'none' ;
28+
29+ }
30+
31+ // disable function instantiation
32+ disableImgResultBtn ( ) ;
33+
34+
2235/**
2336 * Sets the image and the text(if any) to the output element
2437 *
You can’t perform that action at this time.
0 commit comments