Ssmith has uploaded a new change for review. https://gerrit.wikimedia.org/r/198255
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 M src/components/widgets/x-by-y/x-by-y.js 4 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash refs/changes/55/198255/1 diff --git a/src/bower_modules b/src/bower_modules index 1323394..2a4a5f0 160000 --- a/src/bower_modules +++ b/src/bower_modules -Subproject commit 132339455dc0bf26fe7599f2bb57c70800f92b9f +Subproject commit 2a4a5f03b54988ec09e76ef69362c39655481918 diff --git a/src/components/app-content/app-content.js b/src/components/app-content/app-content.js index 2624c2c..95e3998 100644 --- a/src/components/app-content/app-content.js +++ b/src/components/app-content/app-content.js @@ -72,6 +72,16 @@ }; + self.removeWidgetFromBoard = function( event, data ){ + $.ajax({ + method: 'DELETE', + url: '/board/' + self.userdata().defaultBoard + '/widgets/' + event.instanceID, + success: function(stuff) { + alert( JSON.stringify( stuff ) ); + } + }) + }; + 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> diff --git a/src/components/widgets/x-by-y/x-by-y.js b/src/components/widgets/x-by-y/x-by-y.js index 01eaeac..3487941 100644 --- a/src/components/widgets/x-by-y/x-by-y.js +++ b/src/components/widgets/x-by-y/x-by-y.js @@ -13,6 +13,7 @@ WidgetBase.call( this, params ); var self = this, wasSaved = self.chartSaved(); //populateChoices() may overwrite + console.log('params: ', params); self.showSlice = ko.observable(); self.bySlice = ko.observable(); -- To view, visit https://gerrit.wikimedia.org/r/198255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81fa1551af5fbbd36361c22e0172d353c2d0e4ca Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/dash Gerrit-Branch: master Gerrit-Owner: Ssmith <ssm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits