Ejegg has submitted this change and it was merged. Change subject: Remove widgets from boards ......................................................................
Remove widgets from boards WIP need to add to the others tomorrow Change-Id: I81fa1551af5fbbd36361c22e0172d353c2d0e4ca --- M src/bower_modules M src/components/app-content/app-content.js M src/components/widgets/x-by-y/x-by-y.html 3 files changed, 29 insertions(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved diff --git a/src/bower_modules b/src/bower_modules index 1323394..b570271 160000 --- a/src/bower_modules +++ b/src/bower_modules -Subproject commit 132339455dc0bf26fe7599f2bb57c70800f92b9f +Subproject commit b57027165c9375498978d3f65b8324d95621351c diff --git a/src/components/app-content/app-content.js b/src/components/app-content/app-content.js index 2624c2c..db61aed 100644 --- a/src/components/app-content/app-content.js +++ b/src/components/app-content/app-content.js @@ -72,6 +72,20 @@ }; + self.removeWidgetFromBoard = function( event, data ){ + var removingBoard = self.displayedBoard().id; + $.ajax({ + method: 'DELETE', + url: '/board/' + removingBoard + '/widgets/' + event.instanceID, + success: function( ) { + $.get( 'board/' + removingBoard, function( moredata ){ + console.log(moredata); + self.displayedBoard( moredata ); + }); + } + }); + }; + self.setDisplayPage = function( e, data ){ var pages = [ 'Library', 'Profile', 'Home' ], view = data.target.id; diff --git a/src/components/widgets/x-by-y/x-by-y.html b/src/components/widgets/x-by-y/x-by-y.html index a65b3df..2af5887 100644 --- a/src/components/widgets/x-by-y/x-by-y.html +++ b/src/components/widgets/x-by-y/x-by-y.html @@ -15,6 +15,7 @@ <ul class="dropdown-menu" role="menu" aria-labelledby="savedCharts" id="savedChartsMenu" data-bind="foreach: presetTitles, style: { width: '300px'}"> <li data-bind="text: $data"></li> </ul> --> + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="modal" data-target="#removeModal"><i class="fa fa-times"></i></button> </div> </div> @@ -159,3 +160,17 @@ </div><!-- /.modal-content --> </div> </div> + +<div class="modal fade" id="removeModal"> + <div class="modal-dialog modal-sm"> + <div class="modal-content"> + <div class="modal-header"> + <h2>Remove this widget from the board?</h2> + </div> + <div class="modal-body"> + <button class="btn btn-lg btn-success pull-right" data-dismiss="modal" data-bind="click: $parents[2].removeWidgetFromBoard"> OK</button> + <button class="btn btn-lg btn-danger pull-right" data-dismiss="modal"> Cancel</button> + </div> + </div><!-- /.modal-content --> + </div> +</div> -- To view, visit https://gerrit.wikimedia.org/r/198255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I81fa1551af5fbbd36361c22e0172d353c2d0e4ca Gerrit-PatchSet: 3 Gerrit-Project: wikimedia/fundraising/dash Gerrit-Branch: master Gerrit-Owner: Ssmith <ssm...@wikimedia.org> Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits