Skip to content

Commit 6cb1bc6

Browse files
author
robmadeyou
committed
Adding view bridge and binding events
1 parent bb16f44 commit 6cb1bc6

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rhubarb.vb.create('ChosenDropDownViewBridge', function() {
2+
return {
3+
attachEvents:function() {
4+
$(this.viewNode).chosen();
5+
}
6+
};
7+
});

src/ChosenDropdown/ChosenDropdownView.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
class ChosenDropdownView extends DropDownView
88
{
9-
protected function printViewContent()
9+
public function getDeploymentPackage()
1010
{
11-
parent::printViewContent();
11+
$package = parent::getDeploymentPackage();
12+
$package->resourcesToDeploy[] = __DIR__ .'/../../vendor/components/jquery/jquery.min.js';
13+
$package->resourcesToDeploy[] = __DIR__ .'/../chosen.jquery.min.js';
14+
$package->resourcesToDeploy[] = __DIR__ . '/ChosenDropDownViewBridge.js';
15+
return $package;
1216
}
1317
}

0 commit comments

Comments
 (0)