@@ -1202,7 +1202,7 @@ ui.toolbar.export.snippet.click(function() {
12021202 }
12031203 $ ( '<option>' ) . val ( project . id ) . text ( project . path_with_namespace ) . appendTo ( "#snippetExportModalProjects" ) ;
12041204 } ) ;
1205- $ ( "#snippetExportModalProjects" ) . prop ( 'disabled' , false ) ;
1205+ $ ( "#snippetExportModalProjects" ) . prop ( 'disabled' , false ) ;
12061206 }
12071207 $ ( "#snippetExportModalLoading" ) . hide ( ) ;
12081208 } )
@@ -1212,7 +1212,6 @@ ui.toolbar.export.snippet.click(function() {
12121212 . complete ( function ( ) {
12131213 ui . spinner . hide ( ) ;
12141214 } ) ;
1215- return false ;
12161215} ) ;
12171216//import from dropbox
12181217ui . toolbar . import . dropbox . click ( function ( ) {
@@ -1291,7 +1290,7 @@ ui.toolbar.import.snippet.click(function () {
12911290 }
12921291 $ ( '<option>' ) . val ( project . id ) . text ( project . path_with_namespace ) . appendTo ( "#snippetImportModalProjects" ) ;
12931292 } ) ;
1294- $ ( "#snippetImportModalProjects" ) . prop ( 'disabled' , false ) ;
1293+ $ ( "#snippetImportModalProjects" ) . prop ( 'disabled' , false ) ;
12951294 }
12961295 $ ( "#snippetImportModalLoading" ) . hide ( ) ;
12971296 } )
@@ -1301,7 +1300,6 @@ ui.toolbar.import.snippet.click(function () {
13011300 . complete ( function ( ) {
13021301 ui . spinner . hide ( ) ;
13031302 } ) ;
1304- return false ;
13051303} ) ;
13061304//import from clipboard
13071305ui . toolbar . import . clipboard . click ( function ( ) {
@@ -1340,7 +1338,7 @@ ui.modal.snippetImportProjects.change(function() {
13401338 $ ( '<option>' ) . val ( snippet . id ) . text ( snippet . title ) . appendTo ( $ ( "#snippetImportModalSnippets" ) ) ;
13411339 } ) ;
13421340 $ ( "#snippetImportModalLoading" ) . hide ( ) ;
1343- $ ( "#snippetImportModalSnippets" ) . prop ( 'disabled' , false ) ;
1341+ $ ( "#snippetImportModalSnippets" ) . prop ( 'disabled' , false ) ;
13441342 } )
13451343 . error ( function ( err ) {
13461344
@@ -1508,7 +1506,7 @@ $("#snippetImportModalClear").click(function () {
15081506 $ ( "#snippetImportModalContent" ) . val ( '' ) ;
15091507 $ ( "#snippetImportModalProjects" ) . val ( 'init' ) ;
15101508 $ ( "#snippetImportModalSnippets" ) . val ( 'init' ) ;
1511- $ ( "#snippetImportModalSnippets" ) . prop ( 'disabled' , true ) ;
1509+ $ ( "#snippetImportModalSnippets" ) . prop ( 'disabled' , true ) ;
15121510} ) ;
15131511$ ( "#snippetImportModalConfirm" ) . click ( function ( ) {
15141512 var snippeturl = $ ( "#snippetImportModalContent" ) . val ( ) ;
@@ -1563,7 +1561,7 @@ $("#snippetExportModalConfirm").click(function() {
15631561 code : editor . getValue ( ) ,
15641562 visibility_level : $ ( "#snippetExportModalVisibility" ) . val ( )
15651563 } ;
1566-
1564+ if ( ! data . title || ! data . file_name || ! data . code || ! data . visibility_level || ! $ ( "#snippetExportModalProjects" ) . val ( ) ) return ;
15671565 $ ( "#snippetExportModalLoading" ) . show ( ) ;
15681566 var fullURL = baseURL + '/api/v3/projects/' + $ ( "#snippetExportModalProjects" ) . val ( ) + '/snippets?access_token=' + accesstoken ;
15691567 $ . post ( fullURL
0 commit comments