0

maybe someone could help me. I want to open a modal instead of the standard event tooltip, but i'm a .js noob and i can't solve this problem. For now #myModal opens after i pressed the "save" Button of the appearing tooltip, but i want to open the modal on mouse release and prevent the tooltip from appearing. Is this understandable?

Here is my code:

<script type="text/javascript">
YUI().use(
  'aui-scheduler',
  function(Y) {
      var events = [
                    {
                      content: 'Partial Lunar Eclipse',
                      endDate: new Date(2013, 3, 25, 5),
                      startDate: new Date(2013, 3, 25, 1)
                    }
                  ];

                  var agendaView = new Y.SchedulerAgendaView();
                  var dayView = new Y.SchedulerDayView();
                  var eventRecorder = new Y.SchedulerEventRecorder();
                  var monthView = new Y.SchedulerMonthView();
                  var weekView = new Y.SchedulerWeekView();

                  new Y.Scheduler(
                    {
                        activeView: weekView,
                      boundingBox: '#myScheduler',
                      date: new Date(2015, 5, 22),
                      eventRecorder: eventRecorder,
                      items: events,
                      render: true,
                      views: [dayView, weekView, monthView, agendaView]
                    }
                  );
                  Y.Do.before(function() {
                      this.on("save",function(data){ 
                          $('#myModal').modal('show');
                        }); 
                        }, eventRecorder, 'showPopover');
  }

);

SiM
  • 1
  • 1

1 Answers1

0

Just found out how to fix this. Just changed:

  Y.Do.before(function() {
                  this.on("save",function(data){ 
                      $('#myModal').modal('show');
                    }); 
                    }, eventRecorder, 'showPopover');

to

  $( "#myScheduler" ).mouseup(function() {
      $('#myModal').modal('show');
                    });
SiM
  • 1
  • 1