[MediaWiki-commits] [Gerrit] Make MWMediaDialog not crash on API errors - change (mediawiki...VisualEditor)

2014-08-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make MWMediaDialog not crash on API errors
..


Make MWMediaDialog not crash on API errors

resp.query won't be set if resp.error is set instead.

Also rename alignButons to alignButtons.

Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
---
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 910adb4..f401f2e 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -188,7 +188,7 @@
  */
 ve.ui.MWMediaDialog.prototype.initialize = function () {
var altTextFieldset, positionFieldset, borderField, positionField,
-   alignLeftButton, alignCenterButton, alignRightButton, 
alignButons;
+   alignLeftButton, alignCenterButton, alignRightButton, 
alignButtons;
 
// Parent method
ve.ui.MWMediaDialog.super.prototype.initialize.call( this );
@@ -272,11 +272,11 @@
'label': ve.msg( 'visualeditor-dialog-media-position-right' )
} );
 
-   alignButons = ( this.frame.getDir() === 'ltr' ) ?
+   alignButtons = ( this.frame.getDir() === 'ltr' ) ?
[ alignLeftButton, alignCenterButton, alignRightButton ] :
[ alignRightButton, alignCenterButton, alignLeftButton ];
 
-   this.positionInput.addItems( alignButons, 0 );
+   this.positionInput.addItems( alignButtons, 0 );
 
this.positionCheckbox = new OO.ui.CheckboxInputWidget( {
'$': this.$
@@ -590,7 +590,7 @@
'meta': 'filerepoinfo'
} ).then(
function ( resp ) {
-   return resp.query.repos || defaultSource;
+   return resp.query && resp.query.repos || 
defaultSource;
},
function () {
return $.Deferred().resolve( defaultSource );

-- 
To view, visit https://gerrit.wikimedia.org/r/154385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make MWMediaDialog not crash on API errors - change (mediawiki...VisualEditor)

2014-08-15 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/154385

Change subject: Make MWMediaDialog not crash on API errors
..

Make MWMediaDialog not crash on API errors

resp.query won't be set if resp.error is set instead.

Also rename alignButons to alignButtons.

Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
---
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/85/154385/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 910adb4..c3b2097 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -188,7 +188,7 @@
  */
 ve.ui.MWMediaDialog.prototype.initialize = function () {
var altTextFieldset, positionFieldset, borderField, positionField,
-   alignLeftButton, alignCenterButton, alignRightButton, 
alignButons;
+   alignLeftButton, alignCenterButton, alignRightButton, 
alignButtons;
 
// Parent method
ve.ui.MWMediaDialog.super.prototype.initialize.call( this );
@@ -272,11 +272,11 @@
'label': ve.msg( 'visualeditor-dialog-media-position-right' )
} );
 
-   alignButons = ( this.frame.getDir() === 'ltr' ) ?
+   alignButtons = ( this.getDir() === 'ltr' ) ?
[ alignLeftButton, alignCenterButton, alignRightButton ] :
[ alignRightButton, alignCenterButton, alignLeftButton ];
 
-   this.positionInput.addItems( alignButons, 0 );
+   this.positionInput.addItems( alignButtons, 0 );
 
this.positionCheckbox = new OO.ui.CheckboxInputWidget( {
'$': this.$
@@ -590,7 +590,7 @@
'meta': 'filerepoinfo'
} ).then(
function ( resp ) {
-   return resp.query.repos || defaultSource;
+   return resp.query && resp.query.repos || 
defaultSource;
},
function () {
return $.Deferred().resolve( defaultSource );

-- 
To view, visit https://gerrit.wikimedia.org/r/154385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits