@@ -20,7 +20,8 @@ var __ = require('underscore'),
2020 SMTPConnection = require ( 'smtp-connection' ) ,
2121 MediumEditor = require ( 'medium-editor' ) ,
2222 validateMediumEditor = require ( '../utils/validateMediumEditor' ) ,
23- getBTPrice = require ( '../utils/getBitcoinPrice' ) ;
23+ getBTPrice = require ( '../utils/getBitcoinPrice' ) ,
24+ Sortable = require ( 'sortablejs' ) ;
2425
2526module . exports = pageVw . extend ( {
2627
@@ -233,6 +234,7 @@ module.exports = pageVw.extend({
233234 placeholder_text_single : window . polyglot . t ( 'chosenJS.placeHolderTextSingle' ) ,
234235 placeholder_text_multiple : window . polyglot . t ( 'chosenJS.placeHolderTextMultiple' )
235236 } ) ;
237+
236238 $ ( '#settings-image-cropper' ) . cropit ( {
237239 $preview : self . $ ( '.js-settingsAvatarPreview' ) ,
238240 $fileInput : self . $ ( '#settingsAvatarInput' ) ,
@@ -255,6 +257,7 @@ module.exports = pageVw.extend({
255257 console . log ( errorMessage ) ;
256258 }
257259 } ) ;
260+
258261 //cache elements used more than once
259262 self . $moderatorFeeInput = self . $ ( '#moderatorFeeInput' ) ;
260263 self . $moderatorFeeHolder = self . $ ( '.js-settingsModeratorFee' ) ;
@@ -286,6 +289,7 @@ module.exports = pageVw.extend({
286289 console . log ( errorMessage ) ;
287290 }
288291 } ) ;
292+
289293 if ( self . model . get ( 'page' ) . profile . header_hash ) {
290294 $ ( '#settings-image-cropperBanner' ) . cropit ( 'imageSrc' , self . serverUrl + 'get_image?hash=' + self . model . get ( 'page' ) . profile . header_hash ) ;
291295 self . newBanner = false ;
@@ -304,6 +308,12 @@ module.exports = pageVw.extend({
304308 }
305309 } ) ;
306310 editor . subscribe ( 'blur' , self . validateDescription ) ;
311+
312+ self . sortableAddresses && self . sortableAddresses . destroy ( ) ;
313+ self . sortableAddresses = Sortable . create ( self . $ ( '.js-sortableAddresses' ) [ 0 ] , {
314+ chosenClass : "addressBoxDragging" ,
315+ ghostClass : "addressBoxGhost"
316+ } ) ;
307317 } ) ;
308318 return this ;
309319 } ,
0 commit comments