File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1766,6 +1766,25 @@ function show_news() {
17661766 $news_window . center ( ) ; // @XXX - but it helps tho
17671767
17681768 $latest_news . attr ( "tabIndex" , "-1" ) . focus ( ) ;
1769+
1770+ // Prevent opening images dropped on news window
1771+ // especially those dragged from the news window itself (accidentally or habitually/idly)
1772+ // TODO: should this be for all windows?
1773+ $news_window . on ( "dragover" , ( event ) => {
1774+ // the default behavior is to not allow dropping,
1775+ // so don't prevent the default, but do stop propagation
1776+ // so that the global handler doesn't allow the drop
1777+ event . stopPropagation ( ) ;
1778+ } ) ;
1779+ $news_window . on ( "dragenter" , ( event ) => {
1780+ // same as dragover, but just prevents flickering of the cursor basically,
1781+ // when dragover is already handled
1782+ event . stopPropagation ( ) ;
1783+ } ) ;
1784+ $news_window . on ( "drop" , ( event ) => {
1785+ event . preventDefault ( ) ;
1786+ event . stopPropagation ( ) ;
1787+ } ) ;
17691788}
17701789
17711790
You can’t perform that action at this time.
0 commit comments